Create VBA Macro Button to Clear Specific Cells | Multiple Ranges | Keep Formatting | All Sheets

Поделиться
HTML-код
  • Опубликовано: 8 июл 2024
  • Download the featured file: www.bluepecantraining.com/wp-...
    In this video I show you how to write VBA macros to clear specific cells. These macros can be run via a button on your worksheet.
    Table of Contents:
    00:00 - Introduction
    01:13 - Clear a specific cell with a VBA macro button
    03:54 - Clear a specific range of cells with a VBA macro button
    05:20 - Clear multiple ranges with a VBA macro button
    06:55 - Clear selected cells with a VBA macro button
    07:46 - Clear specific cells on another worksheet with a VBA macro button
    09:18 - Clear all worksheets with a VBA macro button
    ------------------------
  • ХоббиХобби

Комментарии • 31

  • @Ty33Budd
    @Ty33Budd 2 месяца назад +2

    Chester, if you have for example 5 worksheets in a workbook. On each sheet you've created a clear button for that sheet. Can you have a master sheet that reference to active each of those macros? With the example you have here, it clears all the data from the sheets, even the data i want to keep, thanks in advance.

  • @workfolder7743
    @workfolder7743 26 дней назад

    Amazing! Thank you, you made this video very easy to follow and understand. You also showed various examples that are very practical in the real world. 🤗

  • @stevesignorelli2885
    @stevesignorelli2885 5 месяцев назад

    I've been struggling with a special workbook that I fill in throughout the year and keep re-using, now I have an easier way to clear each sheet :) Thank you!!

  • @ivangarza1500
    @ivangarza1500 Год назад

    You learn something new every day. This was very useful!! It’s gonna make my life easier at work.

  • @alexrosen8762
    @alexrosen8762 Год назад

    Very useful! Many examples which can be used in different real life scenarios. Thanks

  • @IvanCortinas_ES
    @IvanCortinas_ES 2 года назад

    Thank you Chester. That's a very useful macro-set.

  • @tomstuart5122
    @tomstuart5122 5 месяцев назад +1

    Thank you Chester Tugwell! I was struggling with this and you have helped more than you can imagine :)

  • @JaskC700
    @JaskC700 10 месяцев назад

    Very Helpful!! Especially the enable macros function.

  • @yoohootube12
    @yoohootube12 Год назад

    Thanks, your vid is really simple, helpful, and easy to understand. Subscribed

  • @lilig9239
    @lilig9239 7 месяцев назад

    This is excellent. Thank you!

  • @damuelesington385
    @damuelesington385 11 месяцев назад

    You are a lifesaver thank you

  • @dhiandrarhatnanita3564
    @dhiandrarhatnanita3564 Год назад

    Thank you!

  • @dhilieebandhatchanamoorthi8944
    @dhilieebandhatchanamoorthi8944 18 дней назад

    Thank you

  • @sj2411
    @sj2411 Год назад

    Very good

  • @Edward20100
    @Edward20100 Год назад

    Thanks sir

  • @hawkeye7856
    @hawkeye7856 Год назад +1

    loving 2022, you wake up you have a question , you ask youtube and get the answer in a 11 min summary with visual aid ... my friends we are in the matrix

    • @youngblacklife9419
      @youngblacklife9419 Год назад

      yup its great but scary ! even ai is developing and taking over

  • @garyleskiw181
    @garyleskiw181 Год назад +1

    Very clear, and allowed me to clear multiple and disparate entry cells in a sheet by using a named range (perhaps add named range as an example). However, I could not get it to work when some of the entry cells were merged cells. Looking for this solution as my sheet is an entry form where different width fields are used on each row (so changing column width to avoid merging is not a great option)

  • @justinagordon5068
    @justinagordon5068 25 дней назад

    Excellent! You are so easy to follow! Do you have a video that shows the code that will not clear formulas. What about clear all unlocked cells?

  • @chelamine
    @chelamine 3 месяца назад

    Thank's

  • @LeonidasMaximus
    @LeonidasMaximus Год назад +1

    This was great thanks so much.. Is there a way to get the code to recognize merged cells? Thanks

  • @kartikforanimal
    @kartikforanimal Год назад +1

    Kindly release a video for clearing data of merged cell

  • @Alhusam
    @Alhusam 2 года назад

    Thanks Chester. By the way, did you know that you don't have to type the parentheses after typing the title of the subroutine because the VBA editor will take care of that.

  • @raserex
    @raserex Год назад

    Thanks for this! Now I''m trying to clear a range of cells. So, I've done this and I'm actually clearing a column of data. The data leaves the cells in the row, but I've also got a duplicate conditional format in that column. When I clear the data, the cells turn pink, almost as if the "no data" cells are duplicated. Then, when I manually highlight those cells and press the "delete" key, the cells return to white as normal. When I check the cells then, they still have the duplicate rule on them. I can't figure out why that row is turning pink and furthermore how to correct this. Here is the code I've set to hopefully return that column to no fill. Range("A4:A39").Interior.ColorIndex = xlNone Can you help? FYI, My sheet would most resemble the Non-consecutive cells portion of this tutorial.

  • @PascoReadyMix
    @PascoReadyMix Год назад +1

    Is there a way to clear merged cells as well?

  • @matthewbakke1623
    @matthewbakke1623 5 месяцев назад

    Is there a way to use the "clear all sheets" format to compile / hide all unused rows in multiple worksheets?

  • @aakifahmed8212
    @aakifahmed8212 Год назад

    Hi i have a doubt
    Can we have a button which can Clear all the contents of the multiple sheets present in the same workbook
    If yes
    Can help me with the VBA code

  • @GeekinTX
    @GeekinTX 2 года назад

    When you looped through all the worksheets and cleared each one, why didn't the button disappear too?

  • @romeodariochiu8137
    @romeodariochiu8137 10 месяцев назад

    Sir Chester, good day. I wanna ask you why it can't be saved and everytime I open a workbook, s gone. Thank you.

  • @alparkson5494
    @alparkson5494 Год назад

    When I try this, I get a Compile Error - Wrong number of arguments or invalid property assignment 😌

  • @user-be8qp3gb8l
    @user-be8qp3gb8l 7 месяцев назад

    Thank you!