+ Reply to Thread
Results 1 to 8 of 8

Can I record a macro to record 5 button clicks and assign that to 1 button??

  1. #1
    Forum Contributor
    Join Date
    02-03-2018
    Location
    Edinburgh
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    161

    Can I record a macro to record 5 button clicks and assign that to 1 button??

    I have a sheet that has 8 buttons assigned to run macros to sort/delete information and then build sheets. From there I click on buttons to print the sheets etc required.

    What I would like to do is create a button, record a macro that runs through all the existing button clicks in one go.

    When I try to record the macro it lets me click on the buttons but they don't run their function.

    Is there a way to do this??

    I really don't want to start from scratch and record one long macro.

    TRG Sheets.xlsm

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,482

    Re: Can I record a macro to record 5 button clicks and assign that to 1 button??

    You can call other macro's within a macro, so if you just simply put your 7 macro's linked to the buttons in 1 new sub and link that sub to button8 it will execute all 7 called macro's

    I don't know which 7 buttons you want to be run automatisch but it would look somthing like this for the macro to be linked to button8
    Please Login or Register  to view this content.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Can I record a macro to record 5 button clicks and assign that to 1 button??

    Hi Grant,

    What is the password to your example file so we can understand the problem better?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Contributor
    Join Date
    02-03-2018
    Location
    Edinburgh
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    161

    Re: Can I record a macro to record 5 button clicks and assign that to 1 button??

    TRG Sheets - No password.xlsmTRG Example.xlsx

    TRG Sheet without password. The TRG Example is a sample of the information we recieve. We copy and paste this into the TRG sheet then work from there. It will show you how it works.

  5. #5
    Forum Contributor
    Join Date
    02-03-2018
    Location
    Edinburgh
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    161

    Re: Can I record a macro to record 5 button clicks and assign that to 1 button??

    Quote Originally Posted by MarvinP View Post
    Hi Grant,

    What is the password to your example file so we can understand the problem better?
    How did you know my name?

  6. #6
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,482

    Re: Can I record a macro to record 5 button clicks and assign that to 1 button??

    lol, your name in the excel sheet (see File > Info > Author)
    _______________

    Place this macro in one of your modules and it will fire off the macro's one by one effectivly replaciing pressing the 8 buttons.
    I do recommend replacing the Sort macro never use a macro name that is also a vba code.. call it SortTRG or whatever is appropiate for you

    Please Login or Register  to view this content.

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Can I record a macro to record 5 button clicks and assign that to 1 button??

    Roel got the answer below. File About shows your name. I think his answer is correct also. You need to put his code in a Module that is outside of a Sheet.

    Read:

    http://www.cpearson.com/excel/Scope.aspx

  8. #8
    Forum Contributor
    Join Date
    02-03-2018
    Location
    Edinburgh
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    161

    Re: Can I record a macro to record 5 button clicks and assign that to 1 button??

    Thank you both. I will give it a try and see how I get on

+ 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. Create a user button to record a formatting macro
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2016, 03:55 PM
  2. [SOLVED] Macro to record date button pressed
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2016, 09:54 AM
  3. Excel Macro Won't Record the clicks
    By zit1343 in forum Excel General
    Replies: 1
    Last Post: 07-06-2011, 12:28 AM
  4. Want to record or program macro for a counter button.
    By gragra333 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-15-2010, 01:56 AM
  5. Record Macro Stop Button
    By lwmweb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2007, 09:13 PM
  6. Record a macro, activate by button
    By jimmisavage in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2007, 11:13 AM
  7. [SOLVED] Macro Record Stop Button
    By Patrick Simonds in forum Excel General
    Replies: 2
    Last Post: 07-31-2005, 02:05 PM

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