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

Поділитися
Вставка
  • Опубліковано 25 лип 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
    ------------------------
  • Навчання та стиль

КОМЕНТАРІ • 32

  • @JBERGALIEN
    @JBERGALIEN 12 днів тому

    Excellent video precise & simple to understand straight to the point and no Fuzz, Thank you

  • @Ty33Budd
    @Ty33Budd 3 місяці тому +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.

  • @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.

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

    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. 🤗

  • @tomstuart5122
    @tomstuart5122 5 місяців тому +1

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

  • @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.

  • @JaskC700
    @JaskC700 11 місяців тому

    Very Helpful!! Especially the enable macros function.

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

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

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

    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?

  • @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)

  • @lilig9239
    @lilig9239 8 місяців тому

    This is excellent. Thank you!

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

    Thank you!

  • @damuelesington385
    @damuelesington385 11 місяців тому

    You are a lifesaver thank you

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

    Thank you

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

    Kindly release a video for clearing data of merged cell

  • @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

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

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

  • @matthewbakke1623
    @matthewbakke1623 5 місяців тому

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

  • @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.

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

    Very good

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

    Is there a way to clear merged cells as well?

  • @chelamine
    @chelamine 3 місяці тому

    Thank's

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

    Thanks sir

  • @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

  • @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.

  • @romeodariochiu8137
    @romeodariochiu8137 11 місяців тому

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

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

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

  • @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!