How to open UserForm code by VBA?
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: How to open UserForm code by VBA?

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    'Sup?
    How can I open the UserForm code module by macro. Like when I use VBA to open some regular macro, you know with 'Application.Goto Reference:="the name of the Sub"'. This doesn't work if the Sub is in the UserForm. How should I name the Reference? Any ideas?

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sunny, spring-like Hull
    Posts
    3,339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Just use UserForm1.Show. You can refer to the controls on the userform, from outside it's module, by prefacing the control name with the userform name eg: -

    UserForm1.TextBox1.Text = ""

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-19 12:18, Mudface wrote:
    Just use UserForm1.Show. You can refer to the controls on the userform, from outside it's module, by prefacing the control name with the userform name eg: -

    UserForm1.TextBox1.Text = ""
    How would I exactly use UserForm.Show? I don't want to show the UserForm, I want to open the UserForm code window in VBE by VBA. Understand? To open the Sub something() in the editor by macro and the Sub something is on the UserForm.

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Anyone? Please! Mudface? Cum on man, let me have it...

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Is this really this hard? Cum on guys! Be a punch of pals and give it to me!

  6. #6
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Any of you new guys got an idea?

  7. #7
    Board Regular
    Join Date
    Feb 2002
    Location
    Singapore
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    UserForm1.Show has already been the exact VBA code to show a userform.
    You can try.

  8. #8
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


  9. #9
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    A form is a class module...

    The answer given seems to be right

    Use this syntax

    frmYourForm.Sub_Name

    This will load the form into memory but will
    not show it


  10. #10
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Just to clarify dude.
    You have a form called frmDude
    Contained within the forms code you have a sub called...
    Sub RunThisSub
    'code
    End Sub

    To access this sub outside of the actual running form use this syntax

    frmDude.RunThisSub

    As I said before, this will load the form into memory but will not show it.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com