Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing a Macro to Clear Contents of an Excel Spreadsheet

Status
Not open for further replies.
Jan 22, 2003
92
US
I am trying to write a Macro to Clear the contents of a range on an excel spreadsheet. Any help would be greatly appreciated.

Thanks,
Wendy
 
If your clearing all data try :
Range("your data area").Select
Selection.ClearContents
 
Dear Wendy,
On the Tools drop down, select Macro, Record New Macro. Fill in the activation letter (Ctrl a - z) give it a description in the bottom field, then press Record. At that point, any actions you make with the mouse and key board are being recorded. Clear the fiels you want cleard or if you want all but cell boarders cleared, click the upper left hand block of the sheet (above 1, next to A) right click, click Clear Contents, click any cell (to remove highlighting), re-enable protection and, click Stop Recording. Now everytime you want to clear the sheet, just hold down the Ctrl button and press the activation letter that you chose before starting the macro Recording.
Hope that this helps...EdAcquaro@aol.com if I can be of any more service to you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top