Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jul 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    selecting specific worksheets (Excel 2000)

    I am creating a macro in personal.xls creates a new toolbar. In that toolbar it creates a menu called "Workbooks" and sub menus from there of each workbooks name and for a given workbook the sheets associated with it. (i.e.
    New_toolbar
    ->Workbooks
    ->Book1
    ->Sheet1
    ->Sheet2
    ->Sheet3
    ->Book2
    ->Sheet1
    ->Sheet2
    -> Sheet3
    ......)

    I have gotten that part to work just fine. I link all of the toolbar items associated, by name, with specific worksheets to the same macro and was hoping to find a simple way of determining which 'click' called the macro and select that workbook, worksheet combination. To my knowledge there is no property or method that relates to the calling object for the macro so right now my code recursivly calls itself by, within the macro, selecting each object and through error handling activating that worksheet. The problem that I am running into now is when i skip placing Personal.xls within the toolbar the counters i have for selecting the workbook and worksheets are messed up somehow. I am pretty sure there is a way to determine what, within the toolbar, has been selected because if you are debugging the code it places a check-mark beside the one that I selected.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: selecting specific worksheets (Excel 2000)

    Application.CommandBars.ActionControl is the commandbarbutton that was clicked. Type ActionControl and press F1 to get online help about it.

Posting Permissions

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