D
David Goodall
Hello,
I'm having problem running the following piece of code and would
appreciate any help.
Firstly I've created two comboboxes, the result of one populates the
second. I then want to use the application.vlookup to populate textboxes
on my form.
Private Sub CB2_Change()
Dim appexcel as excel.application
Dim choice as string
Dim wks as worksheet
set choice = CB2.text 'this is the name of the sheet.
Set appexcel = Application
textbox1.text = application.vlookup(CB1.text,
wks(choice).range("A1:N200"),3,true) ' this line errors when I debug
and I think,it is to do with the choice variable.
etc
End sub
Hope this makes sense.
Regards
David
I'm having problem running the following piece of code and would
appreciate any help.
Firstly I've created two comboboxes, the result of one populates the
second. I then want to use the application.vlookup to populate textboxes
on my form.
Private Sub CB2_Change()
Dim appexcel as excel.application
Dim choice as string
Dim wks as worksheet
set choice = CB2.text 'this is the name of the sheet.
Set appexcel = Application
textbox1.text = application.vlookup(CB1.text,
wks(choice).range("A1:N200"),3,true) ' this line errors when I debug
and I think,it is to do with the choice variable.
etc
End sub
Hope this makes sense.
Regards
David