bopo
01-10-2009, 08:06 PM
Hi
Well I'm a little intoxicated, however I wrote a simple Vlookup function, basically I want it to lookup a string (a users name in a worksheet, column B) and return the users ID (which is located in column A) into my current worksheet, however I just can't seem to grasp how to return the customers ID back into the AddOrder(A4) cell, help much appreciated.
Dim StrCustomerName As String
StrCustomerName = Application.InputBox("Please enter the customer's name:", "Customer Name")
Worksheets("AddOrder").Range("A4").Value = Application.VLookup(StrCustomerName, Worksheets("CustomerDetails").Range("A1:B100"), 1, False)
Well I'm a little intoxicated, however I wrote a simple Vlookup function, basically I want it to lookup a string (a users name in a worksheet, column B) and return the users ID (which is located in column A) into my current worksheet, however I just can't seem to grasp how to return the customers ID back into the AddOrder(A4) cell, help much appreciated.
Dim StrCustomerName As String
StrCustomerName = Application.InputBox("Please enter the customer's name:", "Customer Name")
Worksheets("AddOrder").Range("A4").Value = Application.VLookup(StrCustomerName, Worksheets("CustomerDetails").Range("A1:B100"), 1, False)