Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to show User Form when form name is in string?
If I want to reference a control by a string name I use:
Me.Controls("Checkbox" & i).Value So, in VBA code how do I display a User Form with the form name in a string? Application.Run ? Don <www.donwiss.com (e-mail link at home page bottom). |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to show User Form when form name is in string?
Don,
I could not remember how to do this, but Googling came up with this method: VBA.UserForms.Add("UserForm1").Show hth, Doug "Don Wiss" wrote in message ... If I want to reference a control by a string name I use: Me.Controls("Checkbox" & i).Value So, in VBA code how do I display a User Form with the form name in a string? Application.Run ? Don <www.donwiss.com (e-mail link at home page bottom). |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to show User Form when form name is in string?
One way:
Option Explicit Sub testme() Dim myStr As String Dim myUF As Object myStr = "Userform1" Set myUF = UserForms.Add(myStr) myUF.Show End Sub Just in case you meant that you knew the userform's name (not as a string): dim myUF as userform1 set myUF = new userform1 myuf.show Don Wiss wrote: If I want to reference a control by a string name I use: Me.Controls("Checkbox" & i).Value So, in VBA code how do I display a User Form with the form name in a string? Application.Run ? Don <www.donwiss.com (e-mail link at home page bottom). -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
show user form | Links and Linking in Excel | |||
User form/ to show please wait | Excel Programming | |||
User Form Doesn't Show When Tab is Added | Excel Programming | |||
Show user form | Excel Programming | |||
Only Show User Form Once | Excel Programming |