Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control arrays in VBA

Status
Not open for further replies.

chrishooper

Technical User
Joined
Oct 11, 2002
Messages
20
Location
GB
Hi there,

I need to create multiple controls utilising the same subroutines in excel. After much web searching and head scratching i see that control arrays have been disabled in VBA. Can anyone help me to devise an alternative strategy to solve my problem? I am a very inexperienced programmer and need help :D
 
I use the Tag property of the controls (In Access, I've never tried in Excel)

Add a word or phrase to each tag of the control you want to identify.

Then do:

Dim ctl as Control
for each ctl in me.controls
if instr(ctl.tag,"Group1")>0 then
'Do Code Here
end if
next ctl


I use instr so i can have multiple tags on a control.

HTH

Ben ----------------------------------------
Ben O'Hara
----------------------------------------
 
Ben will i be able to add an indeterminate number of new controls at runtime and still use this method?
 
also, how does one trigger the routine you have included? I must be able to do it when any of the included controls are selected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top