Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default comobox-name as variable

Hy!

I have the following problem:
I have a function, which should set the visibility of a variable list of
comboboxes to false.
Let's say I have comboboxes named "1", "2" and "3".
Now I have tried the following:

For counter = 1 to 3
worksheets(my_sheet).counter.visible = False
Next

But now the program is looking for an object with the name "counter", and
not "1" to "3".
Has somebody an idea how I can manage this problem?

Thanks for any help!

Christian Galbavy



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default comobox-name as variable

Depends if its a forms checkbox or a control toolbox combobox.

Former

worksheets(my_sheet).DropDowns(counter).Visible=Tr ue

Latter

worksheets(my_sheet).Oleobjects(counter).Visible=T rue

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Christian Galbavy" wrote in message
...
Hy!

I have the following problem:
I have a function, which should set the visibility of a variable list of
comboboxes to false.
Let's say I have comboboxes named "1", "2" and "3".
Now I have tried the following:

For counter = 1 to 3
worksheets(my_sheet).counter.visible = False
Next

But now the program is looking for an object with the name "counter", and
not "1" to "3".
Has somebody an idea how I can manage this problem?

Thanks for any help!

Christian Galbavy





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
comobox afdmello Excel Discussion (Misc queries) 2 November 26th 05 07:07 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
macro & comobox pandino Excel Programming 1 October 28th 03 06:31 PM
ComoBox Resluts Hans Dummer Excel Programming 2 July 24th 03 11:28 AM


All times are GMT +1. The time now is 02:37 PM.

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"