+ Reply to Thread
Results 1 to 4 of 4

command button

  1. #1
    Registered User
    Join Date
    06-04-2018
    Location
    illinois
    MS-Off Ver
    Microsoft 365
    Posts
    24

    command button

    I am new to using vba and have created 7 macros and am unsure as to if it is possible to assign these to a single command button and if so what my code should look like; or can I assign the module i have them in to a button and if so how would i code that. any help is greatly appreciated.
    Last edited by cmyers5613; 06-04-2018 at 12:18 PM.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: command button

    cmeyers,
    Welcome to the forum.

    With the limited information you provided it will be difficult to answer the questions.
    As far as I know, you can only assign one macro per command button, however, if the button needs to run all the macros, you may be able to combine them all into one.
    Where is the button going to be, on the sheet or in a userform?
    If in a sheet, right click the button then click assign macro, a list of available macros will appear.
    If on a userform, double click the button on the userform and a VBA editor window will open and the code can be pasted/written there.
    We would have to see your code to be able to rewrite them into one module.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,027

    Re: command button

    Like this...Change Macro1 etc to your macro names

    Please Login or Register  to view this content.
    Last edited by Sintek; 06-04-2018 at 12:52 PM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: command button

    Duh.....Thanks sintek, I overlooked the simple once again.

+ 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. Replies: 2
    Last Post: 02-02-2016, 10:27 PM
  2. Insert Command Button that will Activate Command Button on a Different Sheet
    By realvirtuality1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2016, 02:11 PM
  3. VBA code to create command button. Print all sheets then delete command button.
    By Declamatory in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-15-2015, 05:18 PM
  4. Make a Command Button Visible from another Command Button
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2014, 10:11 AM
  5. Create a command button with code with a command button
    By jakara in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2013, 01:28 PM
  6. Replies: 1
    Last Post: 09-17-2007, 09:57 PM
  7. [SOLVED] command button:Can i use a command button to open diffrrent sheets
    By Hellboy in forum Excel General
    Replies: 0
    Last Post: 11-03-2005, 11:00 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