Hi, I wonder if anyone can help. Apologies I'm very new to this but here is what I'm trying to do...
I have a database (in sheet 1, columns A and B covering Name and Department).
Ideally, when a user adds a name into column A on sheet2 I would like it to search my database and return the correct department in column B. Sheet 2 is updated/completed on a daily basis so there is no defined range. The database will also be added to.
I have managed to get exactly what I need when I run it so far with this solely for one cell:
set Datatable = sheet1.range("A:B")
set Name = sheet2.range("A2")
Set Mark = sheet2.range("B2")
Mark.value = application.worksheetfunction.vlookup(Name, Datatable, 2, False)
I'm struggling with how to translate this into an automatic response when the user adds information into any row in column A....Any help is greatly appreciated!
I have a database (in sheet 1, columns A and B covering Name and Department).
Ideally, when a user adds a name into column A on sheet2 I would like it to search my database and return the correct department in column B. Sheet 2 is updated/completed on a daily basis so there is no defined range. The database will also be added to.
I have managed to get exactly what I need when I run it so far with this solely for one cell:
set Datatable = sheet1.range("A:B")
set Name = sheet2.range("A2")
Set Mark = sheet2.range("B2")
Mark.value = application.worksheetfunction.vlookup(Name, Datatable, 2, False)
I'm struggling with how to translate this into an automatic response when the user adds information into any row in column A....Any help is greatly appreciated!