×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

RowSource problem with Combobox in Excel

RowSource problem with Combobox in Excel

RowSource problem with Combobox in Excel

(OP)
Hello all,

I have 20 comboboxes on a userform in excel. Each box are supposed to drop down to reveal a long lists of values (thousands, say).

When the userform initializes, the comboboxes are empty. Then a script is run to set the rowsource for each combobox and it works fine. However, after the userform is unloaded, the rowsource definitions are lost - ie, next time I show the userform, I would need to run the scrip to set the rowsource again. I could set the rowsource manually by typing in the address in the property box; but it wouldn't be dynamic.

Is there any way to set the rowsources programmatically and make them permanent?  

Thanks.

Justin

RE: RowSource problem with Combobox in Excel

Run your VBA loading code from the WorkSheet.Activate event

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

UK steam enthusiasts: www.essexsteam.co.uk

RE: RowSource problem with Combobox in Excel

(OP)
It would work. But I wonder if there's a way for the rowsources to stay with the combobox even after the spreadsheet is closed - you know, same as if I put in the rowsours by hand directly ?

Thanks.

Justin

RE: RowSource problem with Combobox in Excel

Yep, sure is for a standard excel VBA ComboBox. In Properties set Autoload to True and type the appropriate range into ListFillRange property

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

UK steam enthusiasts: www.essexsteam.co.uk

RE: RowSource problem with Combobox in Excel

(OP)
John,

Thanks very much for your help. I'm a bit lost - Autoload and ListFillRange are properties of a listbox right? wondering how I can make a combobox workk the same way?

Thanks again

Justin

RE: RowSource problem with Combobox in Excel

If you're using the normal VBA ComboBox then they are also properties of the ComboBox (at least in Office XP). Must admit I can't remember if they have always been in the old versions

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

UK steam enthusiasts: www.essexsteam.co.uk

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources