+ Reply to Thread
Results 1 to 3 of 3

Code needed to test if user clicked a button

  1. #1
    Subs
    Guest

    Code needed to test if user clicked a button

    Hi all

    Please can anybody help I need the correct syntax, to check If a user has
    clicked on a button .

    Regards

    Subs



  2. #2
    Tom Ogilvy
    Guest

    Re: Code needed to test if user clicked a button

    You would need to handle that in the click event of the the button. Then
    you wouldn't have to text, because the code would execute when they click
    the button.

    Beyond that, you would need to be much more specific about what type of
    button you are working with and when you would want to determine this
    information and why -- what you want to do.

    --
    Regards,
    Tom Ogilvy


    "Subs" <atof31@dsl.pipex.com> wrote in message
    news:ejd6evowFHA.720@TK2MSFTNGP10.phx.gbl...
    > Hi all
    >
    > Please can anybody help I need the correct syntax, to check If a user has
    > clicked on a button .
    >
    > Regards
    >
    > Subs
    >
    >




  3. #3
    Ken Johnson
    Guest

    Re: Code needed to test if user clicked a button

    Subs,
    If it's a button on a worksheet from the forms toolbar then
    Application.Caller returns the button's name. If you want to identify
    the button using its caption eg "Start" then try:
    Dim WhichButton as Shape
    Set WhichButton = ActiveSheet.Shapes(Application.Caller)
    If WhichButton.TextFrame.Characters.Text = "Start" then do something..
    Other than that I really don't know. I mainly work on a Mac so I know
    nothing about ActiveX controls.
    Ken Johnson


+ 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