+ Reply to Thread
Results 1 to 9 of 9

Assign code to Toolbar Created in VB to Hide Sheets and then Rehide

  1. #1
    Registered User
    Join Date
    01-14-2009
    Location
    Worcester, England
    MS-Off Ver
    Excel 2007
    Posts
    19

    Assign code to Toolbar Created in VB to Hide Sheets and then Rehide

    Hi All.

    I have code which creates a tool bar which works Ok, however I can't get the statement correct to assign code to it.

    Please Login or Register  to view this content.
    This is the code that I want to assign to the toolbar:

    Please Login or Register  to view this content.
    All help welcomed!

    Thanks

    Simon
    Last edited by Simon Austin; 01-23-2009 at 05:06 AM. Reason: Solved

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    Your code works for me.

    What do you think is not working?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    Isn't the on action part of the code where you call the macro?
    http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

  4. #4
    Registered User
    Join Date
    01-14-2009
    Location
    Worcester, England
    MS-Off Ver
    Excel 2007
    Posts
    19
    Hi Andy.

    Each piece of code works Ok in it's own right however I'm having trouble calling the hide/unhide code from the tool bar. I'll amend with the OnAction property (Thanks Dave) and get back to you. Thanks for your time.

    Simon

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    As I say worked fine for me.
    Created the toolbar and buttons. Each button executed the correct routine.

    Try adding a msgbox statement to the beginning of each routine so you can see whether it really does run the code or not.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-14-2009
    Location
    Worcester, England
    MS-Off Ver
    Excel 2007
    Posts
    19
    All sorted now thanks all.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    Care to share what you needed to do in order for it to work?

  8. #8
    Registered User
    Join Date
    01-14-2009
    Location
    Worcester, England
    MS-Off Ver
    Excel 2007
    Posts
    19
    Hi andy.

    I was making the error of trying to do it all in a single module. I added the second piece of code to a separate module and hey presto...

    Thanks for your time.

    Simon

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    Thanks for the update.

+ 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