If the customer is in a different workbook, then this changes:
set wowks = workbooks("workordermltestbk.xls").worksheets("sheet9999")
to something like:
set wowks = workbooks("Customer List.xls").worksheets("Sheet1")
(Yes, this Customer List workbook has to be open!)
Use excel's help to learn about the =match() function.
Or visit Debra Dalgleish's site:
http://contextures.com/xlFunctions03.html
and
http://contextures.com/xlVideos08.html#VLookup01
And if you're matching on a single last name, I hope it's unique. If you have
75 Smith's in your database, then that procedure would use the topmost matching
Smith.
And as a user, how would I know if the 47th Smith was the one I wanted.
You may want to consider using a different control. I think a Listbox that
would show more columns would be easier to pick from if I were a user. (A
combobox can show more columns in the dropdown list, but only one value will
appear in the combobox after the choice is made.)
You can hide the columns you want, but what's nice is that you can pick off the
values from those columns without returning to the worksheet.
If you want a small workbook to test, send me a private email.
Remove XSPAM from my address:
(e-mail address removed)