Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Oscar Montgomery   on Feb 01 In MS Office Category.

  
Question Answered By: Tyreece Thompson   on Feb 01

You are just assigning the string "FirstList" as the RowSource. You need to
assign the address of the FirstList named range, as follows:

Sub TEST()
Dim myvar As String
UserForm1.ComboBox1.RowSource = Range("FirstList").Address
myvar$ = Application.WorksheetFunction.VLookup("CC", _
Range(UserForm1.ComboBox1.RowSource), 3, False)
MsgBox myvar$
End Sub

I also recommend including the userform Name as a qualifier when you refer to
the
combobox (you might get an "Object required" error otherwise).

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Problem with VLookup in VBA Or get search suggestion and latest updates.


Tagged: