How To: Clear data & cell contents in Excel using a macro

Clear data & cell contents in Excel using a macro

In order to clear the cell content in Excel, using a macro, you will first need to have a table. If you don't already have a spreadsheet, you will need to create one with random numbers. Next, highlight some numbers, by clicking one box and dragging in order to select a number of boxes. Click Alt + F11. There are two shortcuts that you can use Alt + F11 for the VBA Window and Alt + F8 to view macros. Select your work and the module. Your macro should be Sub Clear_cells() range (C1:C11").clearcontents End Sub. To test it, press Alt F11 and Alt F8. You can also do this for whole worksheets, but inserting the name of the worksheet before "range" in the macro.

Just updated your iPhone? You'll find new emoji, enhanced security, podcast transcripts, Apple Cash virtual numbers, and other useful features. There are even new additions hidden within Safari. Find out what's new and changed on your iPhone with the iOS 17.4 update.

1 Comment

"Your macro should be Sub Clear_cells() range (C1:C11").clearcontents End Sub"

REALLY ?!
And no one sees anything WRONG with this ?

UNDERWHELMED !!

Share Your Thoughts

  • Hot
  • Latest