Be the first user to complete this post

  • 0
Add to List

VBA-Excel: Clear data from Excel Sheet(WorkSheet)

VBA-Excel: Clear data from Excel Sheet(WorkSheet)

Format: WorkBook.WorkSheet.Range.Clear         



Clear data from particular cell:

Dim mainworkBook As Workbook

Set mainworkBook = ActiveWorkbook


-Will clear the data from Cell “A2”

Clear data from more than one cells:


-Will clear the data from Cell “A1” and “C3”

Clear data from range of cells:


-Will clear the data from Range of Cells “A1” to “C4”

Clear data from particular column:


-Will clear the data from entire column “A”

Clear data from particular row:


-Will clear the data from entire Row 2.

Clear all the Used range of data:


Clear all data from more than columns


-Clear data for Columns from A to F

Clear all data from more than rows


Note: Remember “.Clear” will clear the everything from the cell right from cell data to cell formatting, borders etc

If you just want to clear the content or data of the cells without effecting the format and border of the cell use “.ClearContents


Also Read:

  1. VBA-Excel: Copy/Paste data - Copy the Entire data from one sheet to another
  2. VBA-Excel: Open a Excel WorkBook
  3. VBA-Excel : 3D-Ranges – FillAcrossSheets Method
  4. VBA-Excel: Get all the WeekDays or Working days in Specified Date Range, (excluding Satudays and Sundays)
  5. VBA-Excel: Add/Insert multiple objects from a folder in an Excel Document.
  6. VBA-Excel: WorkBook.Save Method
  7. Getting Started with Excel Macro
  8. VBA-Excel: Convert Numbers (Rupees) into Words OR Text - Updated Till 1000000 Crore With Decimal Numbers