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

use name of controls which were created in runtime

Status
Not open for further replies.

Scally84

IS-IT--Management
Apr 26, 2005
18
BE
Hello, I made a userform in Excel on which I will create a few images in runtime. I have the following code:

For intCounter = 1 To 10
strName = "imgTest" & CStr(intCounter)
Set ctl = frmUserForm.Controls.Add("Forms.Image.1", strName, True)
frmUserForm!strName.Height = intCounter * 50
Next

Off course this isn't working (the frmTest!strName.Height part). How can I change the properties of my controls I created in runtime? I don't seem to understand how I can call these controls... please help.

Kind regards
 



Hi,
Code:
frmUserForm!Controls(strName).Height = intCounter * 50


Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top