RowSource Question

JohnSearcy

Board Regular
Joined
Feb 6, 2006
Messages
101
Hi -

Just a simple question......
I want to set the RowSource for the ComboBox on the UserForm in the actual Properties window in the VBA editor and I cannot find the proper way. Always getting the Invalid Property value message. I know how to do it through VBA and it would be simple and work but this is ticking me off. I have tried numerous ways that I have found on the web and nothing works. A recent example of one of the MANY ways I tried:

"=Sheet8!$A$1:$A$104"

I had the sheet named LINING STOCK # but changed it to try it as Sheet8. Still wouldn't work. I would like the sheet to be named LINING STOCK #. It has to be something simple that I have not tried or I may be trying to do something that there is no solution for. Using Office 365 at work. Suggestions?

Thank you,
John
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
The example you showed will work if you omit the "=" sign. I assume you are not really putting the quotes in there either.
Excel Formula:
Sheet8!$A$1:$A$104

After renaming you can use
Excel Formula:
'LINING STOCK #'!$A$1:$A$104
 
Upvote 0
Solution
Thank you 6StringJazzer! Out of all the ones I tried, somehow those didn't make it in there. Thank you, again!
 
Upvote 0
For no particular reason, I guess other than to do it differently this time around to keep fresh and keep learning and try not to forget stuff...... if that all made sense.
 
Upvote 0
Here is an example of how I load A Combobox

A script like this can run when you open The Userform.

Now this example is used when you click a command button
But this script could be made to run when you open the UseForm

VBA Code:
Private Sub CommandButton1_Click()
'Modified  6/13/2022  11:02:10 PM  EDT
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row

With ComboBox1
    .Clear
    .List = Range("A1:A" & Lastrow).Value
End With
End Sub
 
Upvote 0
Just curious. Why do you want to use rowsource and not Vba
You didn't ask me, but I try to push as much work into the worksheet as I can--I let Excel do my coding for me whenever possible. If it's a static range, I hardcode the range into RowSource. If it's a dynamic range, I create a dynamic named range and use that in RowSource. I'm not arguing that it's "better" but that is "why".
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top