How to Create Macro Buttons in Excel Worksheets

Поділитися
Вставка
  • Опубліковано 6 сер 2024
  • Sign up for our Excel webinar, times added weekly: www.excelcampus.com/blueprint...
    In this video I explain the 3 ways to create macro buttons in Excel worksheets. These are buttons that run macros when the button is pressed. Download the Excel file:
    There are 3 ways to add macro buttons to a worksheet in Excel:
    1. Shapes
    2. Form Control buttons
    3. ActiveX buttons
    In the video I explain my favorite method, and the pros & cons of each.
    I also explain how to prevent the buttons from moving and resizing when changes are made to the sheet. This can happen when you add/remove rows & columns, or adjust row height or column width.
    Adding macro buttons to your spreadsheets can make it much easier for other users that are not familiar with Excel. Instead of having them complete a bunch of steps in a complex process, they can just click a button to run a macro. The macro runs your VBA code that automates the task(s).
    Additional Resources:
    How to Enable the Developer Tab in Excel: • How to Enable the Deve...
    How to Add Macro Buttons to the Ribbon (Toolbar) in Excel: • How to Add Macro Butto...
    How to Add a Yes/No Pop-up Message Box Before a Macro Runs: • How to Add a Yes No Po...
    Create Macro Buttons for Filters in Excel: • How to Create Macro Bu...
    Create Macro Buttons for Pivot Tables: • Use Vba Macro Buttons ...
    00:00 Introduction
    00:24 VBA Edito
    00:58 Insert Tab
    01:35 Assigning a Macro
    04:07 Moedifying the Shape
    05:42 Form Controls

КОМЕНТАРІ • 134

  • @petersanderson3364
    @petersanderson3364 4 роки тому +1

    Great tutorial and well explained, thank you for the info and advice. You have saved me hours of frustration trying to modify active x command buttons. Thanks again.

  • @hugoprince5608
    @hugoprince5608 2 роки тому +1

    Jon, thanks great tutorial on creating a macro button from a shape - even an Excel novice like me managed it first time! clear and easy to follow - thanks

  • @hilelfrankenthal8976
    @hilelfrankenthal8976 5 років тому +1

    Thank You! Excellent, well explained, straightforward. Great Job. Helped me lots!

  • @piroozpakdel9415
    @piroozpakdel9415 2 роки тому +1

    THANK YOU SO MUCH FOR SO THOROUGHLY EXPLAINING THIS. I HAD NO IDEA HOW TO INSERT THE BUTTON. WATCHHING YOUR VIDEO I FOUND OUT IT IS JUST LIKE A REGULAR SHAPE! FORMED BY CLICKING AND DRAGGING THE CURSOR ON THE ACTIVE SHEET! THANKS.

  • @Al-vw7qi
    @Al-vw7qi 3 роки тому +2

    Thank you for making these videos short and brief. It is so helpful.

  • @justinfrohnert6427
    @justinfrohnert6427 4 роки тому +2

    Fantastic thank you for such a clear and easy to understand tutorial.

  • @luiwi826
    @luiwi826 2 роки тому +1

    Great video and well explained in a simple and direct way. Thanks!

  • @daniele7512
    @daniele7512 4 роки тому

    thanks! Precise and thorough at the same time concise

  • @DiKaPasisiil
    @DiKaPasisiil 2 роки тому +1

    You are an excellent teacher! Thank you for this video.

  • @sasavienne
    @sasavienne 5 років тому +1

    Thanks Jon. That is brilliant.
    🌟 🌟 🌟 🌟 🌟

  • @LoveNatureforabettertomorrow
    @LoveNatureforabettertomorrow 4 роки тому +8

    Hi Jon, simple yet very useful. I have spent nearly 02 days trying to figure out how to jump from sheet to sheet without having to write a macro and here I am finally and you have saved me from lots of stress 😂 Thank you so much for the tutorial 😊

  • @alwayspositive999
    @alwayspositive999 5 років тому +2

    Great video Jon - you explain very clearly and it's great listening to your videos and learning from them. Thanks

    • @ExcelCampus
      @ExcelCampus  5 років тому

      Thanks! I appreciate your support and kind words. :-)

    • @ravindrapawar5295
      @ravindrapawar5295 4 роки тому

      @@ExcelCampus we yuhttiioooopooppoT fight your yioioo009999998 gf fb hhhhhhHjuuhu hi uiiu

  • @BillHertzing
    @BillHertzing 4 роки тому +1

    Thank you. This was very helpful in my workflow.

  • @filco8494
    @filco8494 Місяць тому

    I found a little workaround to "simulate" the pressed animation for the form. In your recording first record to delete the shadow effect, then comes your main macro, and after that insert the shadow again, then stop recording. It will be just a fraction of a millisecond but thats even enough to get that satisfiyng "pressed" feeling

  • @juanpablogavilanes7036
    @juanpablogavilanes7036 4 роки тому +1

    Thank you for the tutorial

  • @michellebracken68
    @michellebracken68 4 роки тому +1

    Clear and Easy, thanks!

  • @gordonsuploads
    @gordonsuploads 4 роки тому +1

    Great tutorial, saved me from those old clunky form buttons !

  • @yulinliu850
    @yulinliu850 5 років тому +1

    Excellent tutorial! Much appreciated!

  • @travisevans
    @travisevans 5 років тому +1

    Thanks a lot for the video, helpful as always!

  • @kenneth27089
    @kenneth27089 Рік тому +1

    Very good explanation with best tips too! thank you

  • @wayneedmondson1065
    @wayneedmondson1065 5 років тому +5

    Hey Jon.. thanks for the video on adding macro buttons. Question: Is there any way to get a shape to exhibit the "press" visualization that you see when clicking on a Form Control button? It looks like the Form Control press moves the dark border outline from the bottom and right edges to the top and left edges which gives the appearance of a "press" or "indentation.". Have you ever tried to accomplish the same via code to get that kind of animation effect on your shape buttons? Just curious.. might be a fun project. On shapes, I often use the rectangle with gradient fill and a round bevel shape effect to give the appearance of depth. But, it does not "depress" on a click. It would be great if Microsoft would add a "Like Control Button" shape effect for those of us who want to see a button-like action on the click of a shape being used as a button to fire a macro. Thanks again for all your valuable tips and resources Jon. Thumbs up!

  • @anastasiagryn8236
    @anastasiagryn8236 3 роки тому +1

    Thank you very much, that's fantastic!

  • @chrisnannhall
    @chrisnannhall 3 роки тому +1

    Very helpful, thank you!

  • @frankmoore3220
    @frankmoore3220 Рік тому +1

    This is a great tutorial. Thank you very much for posting it. This was very helpful and easy to understand.

    • @ExcelCampus
      @ExcelCampus  Рік тому

      Thanks for your feedback, Frank! :)

  • @MsOfficeLearning
    @MsOfficeLearning 2 роки тому +1

    Thank you your grafting tutorial videos.

  • @jpeter63
    @jpeter63 3 роки тому +1

    Excellent job. thanks for your help

  • @ShubhamJain-du6xm
    @ShubhamJain-du6xm 3 роки тому +1

    Simply Awesome.!

  • @tiramisu3336
    @tiramisu3336 5 років тому +1

    Thank you 😊

  • @boost0722
    @boost0722 Рік тому +1

    Thank You. This was very good tutorial.

  • @rosemaryfindley5206
    @rosemaryfindley5206 5 років тому +1

    Nice tip. Thanks

  • @jiwanjack6197
    @jiwanjack6197 5 років тому

    Great job brother 👍 doing great job

  • @TatvagnaShah
    @TatvagnaShah 3 роки тому +1

    Thank you!

  • @PeteJosephs
    @PeteJosephs 2 роки тому +1

    Thanks. I learned some good tips from your video.

  • @lisaw.1601
    @lisaw.1601 4 місяці тому

    Excellent tutorial. You told me exactly what I needed to know. Thank you!

  • @Msedk
    @Msedk 4 роки тому +1

    Thanks for the learning experience. I'm not much of a fan of all the buttons though. I like the neatness of the cells themselves. Is there a way to use the cell as a button instead of a shape or form button?

  • @rummysandhu1232
    @rummysandhu1232 4 роки тому

    It was very helpful, Thanks, the button I created to create multiple tabs, works great but button gets copy to others sheets as well, I want button to stay on master tab only, please advise .

  • @anthonylobello5365
    @anthonylobello5365 4 роки тому

    Always enjoy and learn a lot from your videos and replies. How does one use the same button or shape to invoke a macro on the first click them another macro on the second click. For example, I want use the same button to hide and unhide a column. 1st click hide, 2nd click unhide (undo), 3rd click hide, etc.? Thank you.

  • @TradeConnectVVS
    @TradeConnectVVS 5 років тому +1

    Just subscribed!

  • @onelessbill
    @onelessbill 4 роки тому +1

    Hi Jon! Thank you very much for your collaboration. Would it be possible for you to show the grouping of the buttons let say 3 buttons and have it floating (view) while scrolling down.
    Thank you in advance.

  • @VipulVKGarg
    @VipulVKGarg 4 роки тому +1

    Hi Jon, That's very insightful video. Can you please share the link of video where you created this macro. I need help with the code.

  • @gulammustafahashmati5471
    @gulammustafahashmati5471 10 місяців тому +1

    Excellent guidance. Thanks

    • @ExcelCampus
      @ExcelCampus  10 місяців тому

      Glad it was helpful @gulammustafahashmati5471 😀

  • @tnchv-a
    @tnchv-a Рік тому +1

    You're a life saver

  • @prasadsardeshmukh3898
    @prasadsardeshmukh3898 3 роки тому +1

    Nicely explained 🤠
    Liked the video and subscribed the channel 😉

  • @jeyamoorthy
    @jeyamoorthy 2 роки тому +1

    Thanks Well explained

  • @chabbsmc
    @chabbsmc 4 роки тому +1

    Thanks!

  • @lucasmoreira3237
    @lucasmoreira3237 Рік тому +1

    Thank you.

  • @dustsettler4596
    @dustsettler4596 4 роки тому +3

    Legend tells that anything you type in google, as long as it ends with "in Excel", will lead you to a video that starts with "Welcome to Excel Campus, my name is Jon and..."
    Amazing work Jon, thank you for existing.

  • @JINGSONG168
    @JINGSONG168 4 роки тому

    Hello sir. Thanks for your video. But can you show us how to make a button "Back" to go back to the previous selected sheet ? Thank you

  • @yamunaprasad5655
    @yamunaprasad5655 6 місяців тому

    Great video very helpful

  • @deborahletke1777
    @deborahletke1777 4 роки тому

    Great help, however, I have a large workbook and I need to change the size of the macro buttons which are 3 to a sheet. How can I change them all the same time without having to do each sheet separately? thanks

  • @gssalian1
    @gssalian1 3 роки тому +1

    Thanks a lot.. .

  • @JamesWilliams-ww6si
    @JamesWilliams-ww6si 5 років тому +1

    Always great to use your teaching and glean from your insight. I've usually just used Form Control but I like the shape attributes. Will definitely being using this one. Your free vba macro webinars are supper - your website superb. You are one of the best Jon. THANKS!

    • @ExcelCampus
      @ExcelCampus  5 років тому

      Thank you James! I really appreciate the nice feedback, and your support. I'm happy to hear you will be putting these techniques to use. :-)

  • @ProtomanEX868
    @ProtomanEX868 4 роки тому +1

    Thank you

  • @396Jym
    @396Jym 5 років тому +1

    Excellent tutorial!

    • @ExcelCampus
      @ExcelCampus  5 років тому

      Thank you James! :-)

    • @396Jym
      @396Jym 5 років тому +1

      @@ExcelCampus You were easy to understand and concise without being overstating...You're very Welcome!

  • @bcBiz
    @bcBiz 5 років тому

    Thank you. A question, will this work on all older versions of Excel?

  • @caragliavincenzo
    @caragliavincenzo Рік тому

    Really nice video tutorial.
    I would like to know if you have made a video where you can connect a Macro (Sub) to Command Botton on UserForm (Privite Sub)?

  • @Sunmeet4424
    @Sunmeet4424 3 роки тому +1

    Nice 👍

  • @tharakaswalpita
    @tharakaswalpita 2 роки тому

    Thanks

  • @Dave-lr2wo
    @Dave-lr2wo 3 місяці тому

    This could not be better.

  • @briancross6884
    @briancross6884 5 років тому

    I have created macro buttons for some time & they work well. The only problem I have now is that I do not know how to protect them from being modified. When I protect the worksheet, Excel automatically selects Edit objects & Edit scenarios in the Protect Sheet option. I do check Select unlocked cells only. That works in that you can click on the button & do what I want. For example, if the macro switches to a different worksheet - that works fine. However when I come back to the same sheet, even though I have protected that sheet, it is now unprotected!
    Jon - I don't understand this & am unable to figure this out! Thank you for all of your help!!!

  • @md.saifulislamtuku9303
    @md.saifulislamtuku9303 5 років тому +1

    Thanks-Jon

  • @gdlibeer
    @gdlibeer 5 років тому

    Jon, after adding a button and assigning a macro to it, every time I just open the Workbook can immediately close it I am asked if I want to save changes. Am I doing something wrong? Thanks, Gary

  • @suchithavishwa939
    @suchithavishwa939 Рік тому +1

    super

  • @wesh7137
    @wesh7137 2 роки тому

    Thanks. I created a macro to duplicate an active sheet with a button but I would like to rename the duplicate sheet based on the text in a cell on another sheet in the workbook. How would I do this?

  • @jesbruinsma1790
    @jesbruinsma1790 5 років тому +1

    Is it possible for multiple Macros to be ran from 1 button?

  • @michaelsong6306
    @michaelsong6306 3 роки тому

    Thanks. But how do I insert the button in different places? And when would I do that. So for example, I do a reformat each month. The next months data sheet comes in -- how do I add the button to the new worksheet?

  • @ricro880
    @ricro880 4 роки тому

    I have created a countdown timer command buttons for start and stop. How do I replicate these on others worksheets in the same work book

  • @marinki
    @marinki 3 роки тому

    im preety new to exel, but im curious if you could controll other windows with an exel button click, my question is, can i create a button which copy pastes and choses tabs in other windows, or are the buttons only working inside of exel

  • @fatihkaran
    @fatihkaran 5 років тому +6

    Hi Jon, when I create a button and assign a macro to it, everytime I click (and run the macro) the button disappears. Do you have a solution for this behaviour? I did try the properties options, but it didn't help

    • @Tubeytime
      @Tubeytime 3 роки тому

      Is the macro designed to delete buttons? ;)

  • @sandeepchawla3776
    @sandeepchawla3776 4 роки тому

    Can we create button looks similar to particular cell size and shape ?

  • @chrisfor
    @chrisfor 2 місяці тому

    When I click my shape/button, I get the transform controls around it. How to I prevent the transform controls from showing up when I click my shape?

  • @wurimchoji2629
    @wurimchoji2629 3 роки тому

    Hi, can I add a botten that will enable me print document directly from a designed template instead of using Ctr+P.

  • @tkdlance1
    @tkdlance1 Рік тому

    Can you add the link and/or explain how you wrote the Macro for the Table of Contents? The video says you have a video explaing it but I dont see it anywhere.

  • @anon2436
    @anon2436 4 роки тому

    is there a way to link two groups of clickable buttons that have different macros assigned to what you click on? i.e Group 1 = 1, 2 Group2 = a, b. you get a different macro when you click on 1a, 1b, 2a, or 2b

  • @mikelennon1078
    @mikelennon1078 3 роки тому

    Excel 2019- What is the easiest way to add command button to go to First Record, Last Record, Previous Record, Next Record, etc.? Can this be done without VBA?

  • @beenay18
    @beenay18 Рік тому

    calling subprocedure from button malfunctions but running it from vba editor works fine. what might be the reason?

  • @aaronsacks7539
    @aaronsacks7539 Рік тому

    Hi,
    Any way to add the same button in multiple sheets at once?

  • @arvinattaie8415
    @arvinattaie8415 4 роки тому

    how can i eliminate the question of running micro once tapping the bottom ? thanks

  • @moali1836
    @moali1836 Рік тому

    Can you change the colour after the button has been pressed?

  • @KubieQ
    @KubieQ 4 роки тому

    How do we create a custom button on ribbon FOR MAC???

  • @myentertainment3754
    @myentertainment3754 2 роки тому

    Hi Jon,
    How to run multiple macros without open no of modules

  • @MarkUnique
    @MarkUnique 5 років тому

    How can a hot-key (not macro) be assigned to a button?

  • @Atudo.
    @Atudo. 6 місяців тому

    I have a question. I’m working on one project and I don’t find the right formula for check boxes. Example: let’s take numbers from 1 to 20 and alocate 2 colours ( orange for odd and green for even ) and we have 4 results where need to stock data ( 1 to 10 = low / 11 to 20 high ) and we have box1 = low even green / box2 = low odd orange / box3 = high even green / box4 = high odd orange. When tick a box on number 1 for example, need in box1 = 1 but tick need to be gone after marking it and then let’s say we select 7, in box1 = 2 … sum and count formulas are not working unless I miss something. Is there any coding that needs to be ajusted ?

  • @deepakshahani1295
    @deepakshahani1295 4 роки тому

    I would like to create a button and record Marco so I can click and the picture will blow up to a slightly bigger size, than create a button to allow the picture to fit in back to its size

  • @muhammadrasul1581
    @muhammadrasul1581 4 роки тому

    Can i use macro for texts too?

  • @Atudo.
    @Atudo. 6 місяців тому

    Will buttons work for this better??

  • @walterrabusa1814
    @walterrabusa1814 2 роки тому

    Hi Sir Jon,
    Good day!
    how to enlarge MAcro button because my button is active x control and it shrink to very small button and Im having a hard time. Pls help Sir

  • @Stephenpettitt198
    @Stephenpettitt198 Рік тому

    My buttons aren’t working anymore, any idea how to restore them? I think I messed up the formatting of the spreadsheet when I pasted something into it from another sheet

  • @Drjay18
    @Drjay18 2 роки тому

    i am trying macro for the first time and have no clue in making it work in steps. Like in debug, any ideas?

  • @TravisFX
    @TravisFX 3 роки тому

    How do you make it look like its been clicked? Pressed etc..

  • @madalingabriel2583
    @madalingabriel2583 3 роки тому

    Where can I find the button immage options?

  • @srinuvenkat78
    @srinuvenkat78 4 роки тому

    How activate the button to run the macro as per tool???

  • @nishant205
    @nishant205 5 років тому

    How can I click that macro button if my mouse is not working ?

  • @mostafaali121
    @mostafaali121 4 роки тому

    how to add save as pdf to excel menu bar ?

  • @nighthawkadventure
    @nighthawkadventure 3 роки тому

    How do i add a button that i can click on and it highlights another cell for me ?

  • @skrai4413
    @skrai4413 3 роки тому

    Sir, which version of excel are you using?, mine is 2007 and i don't see all those options...

  • @robertobjlano2216
    @robertobjlano2216 Рік тому

    Is is possible to create a button just o paste something I have copied from a website? I have been looking for that but cant find anything :(

  • @beenay18
    @beenay18 Рік тому

    running sub-procedure from button malfunctions but running it from vba editor works fine?
    this problem started when i protected all worksheet.
    I wrote the following code to unprotect all the sheets at the beginning of sub-procedure
    and again protect all worksheet in the end of sub-procedure.
    Please help!
    sub name()
    Dim ws As Worksheet
    For Each ws In Worksheets
    ws.Unprotect
    code
    Dim ws As Worksheet
    For Each ws In Worksheets
    ws.Unprotect
    end sub

  • @chrisrobidoux820
    @chrisrobidoux820 4 роки тому

    I did step 2 the same way and 2nd line up nothing happened? Should I be replacing something on the 2nd one?
    doing 20 more sheet
    -------------------------------
    Sub Macro1()
    '
    Macro1 Macro
    ' Run Opitimzer
    '
    X = SolverSolve(True)
    End Sub
    ---------------------------------------------------------------------
    Sub Macro4()
    '
    Macro4 Macro
    ' Clear Optimizer
    '
    Range("I2").Select
    ActiveCell.FormulaR1C1 = "0"
    Selection.AutoFill Destination:=Range("I2:I201")
    Range("I2:I201").Select
    End Sub
    ---------------------------------------------------------------------------------------------------------------------------
    Sub Macro5()
    '
    Macro5 Macro
    ' Mult2
    '
    X = SolverSolve(True)
    End Sub
    --------------------------------------------
    Sub Macro6()
    '
    Macro6 Macro
    ' Clear Optimizers
    '
    Range("I2").Select
    ActiveCell.FormulaR1C1 = "0"
    Selection.AutoFill Destination:=Range("I2:I201")
    Range("I2:I201").Select
    End Sub

  • @TheRapasc
    @TheRapasc 3 роки тому

    Good video but is there a way to click on a button("Show Purchases" or "Show Sales" or "Both") and have a cell show "Purchases" or "Sales" or "Purchases and Sales")?