Clear Worksheet Using Excel VBA | Excel VBA Automation

Clear Worksheet
  • Save

Introduction/Problem Statement/Business Need:

This article is to Clear Worksheet or deletes contents, comments, and formats from worksheet using VBA code.

Solution:

In many a case, a user would like to clear the contents, formats, and comments from a worksheet without manual intervention.

Clear Everything (Contents, Formats, Comments, etc.):

This code will clear the contents, formats, and comments of range (“A1:B10”) of the sheet1.

Clear Everything
  • Save

Clear Contents:

This code will clear the contents of the range (“A1:B10”) of the sheet1. clear contents properties only clear the contents of the specified range, the format remains the same.

Clear Contents
  • Save

Clear Formats

This code will clear the format of a specified range, contents will remain the same.

Clear Formats
  • Save

Clear Comments

This code will clear only the comments of the specified range.

Clear Comments
  • Save

Clear Entire Worksheet

This code will clear the entire worksheet including formats and comments.

Clear Entire Worksheet
  • Save

Delete Worksheet UsedRange

We can also delete the entire worksheet’s used range.

Delete Worksheet UsedRange
  • Save

Clear Worksheet Using Variable

We can clear a sheet defined by a variable

Clear Worksheet using Variable
  • Save

Conclusion :

If you want to clear worksheet in a workbook then you may use any of the above code instead of manually doing it.

Don't miss out!
Subscribe To Newsletter

Get the latest Excel, VBA, Automation, Tips & Tricks, delivered straight to your inbox.

Invalid email address
Give it a try. You can unsubscribe at any time.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copy link
Powered by Social Snap