+ Reply to Thread
Results 1 to 3 of 3

ActiveX CommandButton Macro

  1. #1
    Registered User
    Join Date
    07-20-2011
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    ActiveX CommandButton Macro

    Hi all,

    I have a command button which should run this code:

    Please Login or Register  to view this content.
    The code is fine, if I put it into a module and run it, it does exactly what I want.

    However, I can't run it from a module as when I click 'go to code' for the button it goes to the sheet and starts a Sub for it.

    if I put the code into this Sheet1 Private Sub and then click the button it only runs the message1 and clear parts and not any of the find function (which I know works)

    any ideas?

    Cheers,

    Bryn

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: ActiveX CommandButton Macro

    In a worksheet code module all Range calls that are not preceded with a worksheet object are applied to the sheet containing the code. This I think is causing an error which your code does not report (as it's not a 91 error). Change the code to use proper qualified syntax:
    Please Login or Register  to view this content.
    and see if that helps.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    07-20-2011
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: ActiveX CommandButton Macro

    I removed the OnError to see what was going on (silly me)

    and I got rid of a line of code for sheet3 and now it works, thanks!

    Bryn

+ 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