Do you do the same thing over and over again in Excel, want to get automating with some simple macros and VBA, here is a great one to get started.
Lost of people would either use the same template or Excel worksheet and manually select the cells to clear by highlighting them. Here is a great way with a simple piece of VBA to automate this procedure if you always delete the same cells – like I do then this small piece of code will do the trick
‘ The above clears all cells, but you can if specify a range that you regularly delete for example’
‘ substitute the “Selection” for “Range(“A1:D5″)”, or your suitable’
It is really easy to install this piece of code.
- Open Excel
- Right click on the sheet you want to install the code in
- Hit view code
- Copy the code above and paste it into the window where the cursor is flashingClose the VBA window
In my example I have chosen to delete A2 to D5, this way I can keep my column headings as I re use these over and over again.
Give this one a go and let us know how much time you save?
Do you know another way to do this?- share it with other Excellers……….
Other Excel Tips You Might Like