howitusedtowas
New Member
- Joined
- Jul 21, 2014
- Messages
- 40
Hi!
I made a userform via ActiveX Controls on my sheet, and I have a list box that uses Vlookup to fill in two other text boxes on my userform. Therefore, when the user clicks the part number from the listbox, the Part description ( TextBox1 ) and Std. Hours (TextBox2) for the part is filled out.
However, I have two different sheets, Vlookup uses, for each Text Box. Meaning,
TextBox1.Value = WorksheetFunction.VLookup(ListBox1.Value, Worksheets("Parts Master").Range("A:B"), 2, False)
TextBox2.Value = WorksheetFunction.VLookup(ListBox1.Value, Worksheets("Lab Master").Range("A:B"), 2, False)
Part description uses the parts master sheet to look up the, and my Std. Hours looks up the Lab Master.
SO HERES MY PROBLEM
Sometimes when the user clicks the part from the listbox, the part description is there but the STD hours isn't listed on my Lab Master. But thats ok, however my excel keeps giving me a Run-Time error. I just want a msg box saying "No STD. Hours found".
I hope that makes sense, I'm pretty new to this!
PLEASE HELP
I made a userform via ActiveX Controls on my sheet, and I have a list box that uses Vlookup to fill in two other text boxes on my userform. Therefore, when the user clicks the part number from the listbox, the Part description ( TextBox1 ) and Std. Hours (TextBox2) for the part is filled out.
However, I have two different sheets, Vlookup uses, for each Text Box. Meaning,
TextBox1.Value = WorksheetFunction.VLookup(ListBox1.Value, Worksheets("Parts Master").Range("A:B"), 2, False)
TextBox2.Value = WorksheetFunction.VLookup(ListBox1.Value, Worksheets("Lab Master").Range("A:B"), 2, False)
Part description uses the parts master sheet to look up the, and my Std. Hours looks up the Lab Master.
SO HERES MY PROBLEM
Sometimes when the user clicks the part from the listbox, the part description is there but the STD hours isn't listed on my Lab Master. But thats ok, however my excel keeps giving me a Run-Time error. I just want a msg box saying "No STD. Hours found".
I hope that makes sense, I'm pretty new to this!
PLEASE HELP