+ Reply to Thread
Results 1 to 6 of 6

2 button , same macro

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    2 button , same macro

    I want to have 2 buttons on different sheets for the same macro. this is what I have so far:

    I have 1 button doing this:
    Please Login or Register  to view this content.
    But the same macro, I want to make another button doing the same thing, but in another sheet.
    and this is what I have:
    Please Login or Register  to view this content.
    Please help, should be simple for someone who knows vba, thank you.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: 2 button , same macro

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: 2 button , same macro

    when I go view code, its in another sheet, and it don't seem to do anything. this first button is in 'inventory' sheet, and the second button I want it to be in 'summary' sheet.
    should I open a new module?

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: 2 button , same macro

    Your code doesn't necessarily need to be in different modules. You can place the code in your initial post into a module, rather than the Sheet level.

  5. #5
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: 2 button , same macro

    ok, your code works, thanks, but could you give me direction on how you did that?
    I go to 'design mode' then I 'insert' and I pick a button, from there what do I do?

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: 2 button , same macro

    To paste a button to the WorkSheet, select the button as you have already done ... move you mouse cursor to the location where you want the button ... and left click once.

    A small window will appear, select the macro name that you want the button attached to and left click.

    Voila !

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automatically add button when data added to cell and apply macro to button?
    By dori2o in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-14-2016, 11:56 AM
  2. Inserting Row Macro using Command Button (ActiveX) relative to Button
    By mebailey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2016, 09:17 PM
  3. Replies: 30
    Last Post: 11-06-2013, 12:43 PM
  4. [SOLVED] Macro button copies sheet containing a macro button as an image
    By namso1902 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2013, 03:51 PM
  5. Modifying a Macro Button to time stamp when the button was clicked.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-22-2010, 04:46 PM
  6. Abort button for a macro(not the break key) and pause/resume button
    By c.vaibhav in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-21-2009, 04:22 AM
  7. A macro to create a form button, assign a macro and name the button
    By cl361 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2008, 01:07 AM

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