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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables in control names 1

Status
Not open for further replies.

jadedinvasion

Programmer
Feb 8, 2005
22
CA
Is it possible to use counter variables in control names?

I have a series of dropdown boxes named cboDept1, cboDept2, cboDept3 ect.. and was wondering if I could reference them in my module with a variable instead of hardcoding the names.

Something like cboDept & intCnt &.value (I know that doesn't work, but it kind of details what I'm tryin to do)

Any ideas would be fantastic! Thanks :)
 
Something like
Code:
    For i = 1 To 6
        UserForm1.Controls("CBODept" & i).Value = True
    Next

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top