Computer Engineers

 
Home | Computer engineering other top | Fiber / Wireless / Copper Tran | Semiconductor engineering
  Position:HOME>Programming language engineeri>Article Content
RowSource problem with Combobox in Excel
Source:Internet Author:Unknow Pubdate:2008-04-14  
IMAO (Aeronautics) 16 Dec 04 12:03
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

johnwm (Computer) 16 Dec 04 14:50
Run your VBA loading code from the WorkSheet.Activate event Good Luck
johnwm
字串5

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

UK steam enthusiasts: www.essexsteam.co.uk

IMAO (Aeronautics) 16 Dec 04 15:04
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



johnwm (Computer) 16 Dec 04 15:50
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
字串8

IMAO (Aeronautics) 16 Dec 04 17:18
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

johnwm (Computer) 16 Dec 04 19:15
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


(Click:

Previous:getlogin in C programming   Next:Porting a Windows NT C++ app to XP platform
[Add TO Favorites] [TOP] [PRINT] [CLOCE WINDOWS]  
  Hot Article
·PIC code for triac light dimme
·Connecting a Footswitch to an
·Siemens s7-200 PLC & Visua
·TETRIS source code is availabl
·XML Files and Terramodel
·controlling GPIB from VBA
·LINKING MSC PATRAN WITH INTRAN
·How to interface RS-485 / Modb
·VBA WITH AB PLC
·SIEMENS: I/O, NCDDE AND DCTL
·getch() function
·Visual Basic Serial Comms To S
  Related Articles
·Porting a Windows NT C++ app t
·Visual Basic
·Convert Excel to PDF
·Automatic delete files
·Prolog help
·C win32 threads
·how to make use of the results
·GTCO-Calcomp & USB to serial a
·E1055: Unable to open 'windows
·MsgBox in VB6
·Anyone use LoadLibrary
·How to create a bootable PC ca
Power by DedeCms