Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default combobox increment

Is there a way of using a for/next routine to call a multitude of comboboxes.
i.e, if I have say, 100 comboboxes, something like

combo = combobox & i
for i = 0 to 99
me.cells(rowno,cellno) = combo.value (this being each combo box from
combobox1 onwards)

next i

as opposed to having to type out a routine for each combobox?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default combobox increment

I think you'll need to use an object variable and then Set this
variable to each Combobox in turn.
So something more like:

Dim Combo as Object
Dim i as Integer

for i = 0 to 99
set Combo = combo & i
cells(rowno,cellno) = combo.value
next i


(not tested so my throw a bug, but I'm sure it is moving in the correct
direction)

Rgds
J


KneeDown2Up wrote:

Is there a way of using a for/next routine to call a multitude of comboboxes.
i.e, if I have say, 100 comboboxes, something like

combo = combo & i
for i = 0 to 99
me.cells(rowno,cellno) = combo.value (this being each combo box from
combobox1 onwards)

next i

as opposed to having to type out a routine for each combobox?

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default combobox increment

Ok, thanks for that. It comes back with an error message of Object variable
not set?

I then changed the line ' Set combo = combo & i' to 'Set combo = combobox &
i ' and received a "Object required" error.

"WhytheQ" wrote:

I think you'll need to use an object variable and then Set this
variable to each Combobox in turn.
So something more like:

Dim Combo as Object
Dim i as Integer

for i = 0 to 99
set Combo = combo & i
cells(rowno,cellno) = combo.value
next i


(not tested so my throw a bug, but I'm sure it is moving in the correct
direction)

Rgds
J


KneeDown2Up wrote:

Is there a way of using a for/next routine to call a multitude of comboboxes.
i.e, if I have say, 100 comboboxes, something like

combo = combo & i
for i = 0 to 99
me.cells(rowno,cellno) = combo.value (this being each combo box from
combobox1 onwards)

next i

as opposed to having to type out a routine for each combobox?

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
Combobox items determined by the selection in another combobox Alerion Excel Programming 2 September 13th 06 01:07 PM
Increment/Increment letter in alphabetical order Neil Goldwasser Excel Programming 3 January 25th 06 09:07 AM
ComboBox list reliant on the entry from a different ComboBox ndm berry[_2_] Excel Programming 4 October 4th 05 04:40 PM
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox Minitman[_4_] Excel Programming 3 October 26th 04 07:58 PM


All times are GMT +1. The time now is 03:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"