Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rowsource type mismatch

Status
Not open for further replies.

Westicle

Programmer
Aug 22, 2002
29
0
0
GB
Sorry to ask a quesion I know has been answered before but I can't find it.

I get a type mismatch with the following code.

Sub GetData()

UserForm1.ComboBox1.RowSource = Worksheets("Sheet1").Range("A1:A10")

End Sub

If I just use RowSource "A1:A10" then it works fine but I need to say which sheet to take it from.
 
Have you tried this ?
UserForm1.ComboBox1.RowSource = Worksheets("Sheet1").Range("A1:A10").Address

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I don't get a type mismatch now but it's picking up the range on the active sheet and not the sheet i'm specifying.
 
And what about this ?
UserForm1.ComboBox1.RowSource = Worksheets("Sheet1").Range("A1:A10").Address(External:=True)

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
That works perfectly.

Thanks for your help PH.

Westicle.
 
Westicle,

Try changing the address to INclude the sheetname:
UserForm1.ComboBox1.RowSource = Worksheets("Sheet1").Name & "!" & Worksheets("Sheet1").Range("A1:A10").Address

HTH


Cheers
Nikki
[bat] Look, mommy, I'm flying!
 
Apologies

hadn't seen the q was already answered



Cheers
Nikki
[bat] Look, mommy, I'm flying!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top