+ Reply to Thread
Results 1 to 5 of 5

How to click the button from module?

  1. #1
    OKLover
    Guest

    How to click the button from module?

    Hi, all

    Does it possible to click the commandbutton(or activate the
    commandbutton_click event) on the userform from the global module?

  2. #2
    Tom Ogilvy
    Guest

    Re: How to click the button from module?

    If you make it public instead of private

    Public Sub CommandButton1_Click()

    end Sub

    then in another module you can do

    Sheet1!CommandButton1_Click

    Where sheet1 is the code name of the sheet containing the code.
    --
    Regards,
    Tom Ogilvy

    "OKLover" <[email protected]> wrote in message
    news:[email protected]...
    > Hi, all
    >
    > Does it possible to click the commandbutton(or activate the
    > commandbutton_click event) on the userform from the global module?




  3. #3
    OKLover
    Guest

    Re: How to click the button from module?

    What if the commandbutton is on the userform? how to call it?

    "Tom Ogilvy" wrote:

    > If you make it public instead of private
    >
    > Public Sub CommandButton1_Click()
    >
    > end Sub
    >
    > then in another module you can do
    >
    > Sheet1!CommandButton1_Click
    >
    > Where sheet1 is the code name of the sheet containing the code.
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "OKLover" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi, all
    > >
    > > Does it possible to click the commandbutton(or activate the
    > > commandbutton_click event) on the userform from the global module?

    >
    >
    >


  4. #4
    Harald Staff
    Guest

    Re: How to click the button from module?

    Sub Demo()
    Call UserForm1.CommandButton1_Click
    End Sub


    HTH. Best wishes Harald

    "OKLover" <[email protected]> skrev i melding
    news:[email protected]...
    > What if the commandbutton is on the userform? how to call it?
    >
    > "Tom Ogilvy" wrote:
    >
    > > If you make it public instead of private
    > >
    > > Public Sub CommandButton1_Click()
    > >
    > > end Sub
    > >
    > > then in another module you can do
    > >
    > > Sheet1!CommandButton1_Click
    > >
    > > Where sheet1 is the code name of the sheet containing the code.
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "OKLover" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hi, all
    > > >
    > > > Does it possible to click the commandbutton(or activate the
    > > > commandbutton_click event) on the userform from the global module?

    > >
    > >
    > >




  5. #5
    OKLover
    Guest

    Re: How to click the button from module?

    Thank you

    "Harald Staff" wrote:

    > Sub Demo()
    > Call UserForm1.CommandButton1_Click
    > End Sub
    >
    >
    > HTH. Best wishes Harald
    >
    > "OKLover" <[email protected]> skrev i melding
    > news:[email protected]...
    > > What if the commandbutton is on the userform? how to call it?
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > If you make it public instead of private
    > > >
    > > > Public Sub CommandButton1_Click()
    > > >
    > > > end Sub
    > > >
    > > > then in another module you can do
    > > >
    > > > Sheet1!CommandButton1_Click
    > > >
    > > > Where sheet1 is the code name of the sheet containing the code.
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > > "OKLover" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > Hi, all
    > > > >
    > > > > Does it possible to click the commandbutton(or activate the
    > > > > commandbutton_click event) on the userform from the global module?
    > > >
    > > >
    > > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1