How to Clear Contents in Excel Without Deleting Formatting

 

Method 1 – Using an Excel Keyboard Shortcut to Clear Content Without Deleting Formatting

We have a dataset containing 5 employees’ names, sales, salary, working hours, and nationality. Each column has a different color formatting. The Sales and Salary columns have Accounting data. We want to clear all the content in this Excel without deleting formatting.

Sample Dataset to Clear Contents in Excel Without Deleting Formatting

Steps:

  • Select the cells (B4:F9 here) that you want to clear.
  • Press the Del / Delete key on your keyboard.

Press Del/Delete to Clear Contents in Excel Without Deleting Formatting

  • All the content is cleared, but the formatting still exists.

Cleared Contents Except Formatting

  • The data formats also remain exactly the same. Write something in the Sales column and you will see it will show a dollar sign automatically after putting the value.


Method 2 – Using the Clear Button from the Editing Option to Erase Content Without Changing the Cell Format

Steps:

  • Select the cells B4:F9 that you want to clear.
  • Go to the Home tab and the Editing group.
  • Select the Clear tool and choose the Clear Contents option.

Using Clear Contents Option to Clear Contents in Excel Without Deleting Formatting

Note:

You can also find the Clear Contents option in the context menu when right-clicking on your mouse over a range of data.

Clear Contents Option in the Context Menu


Method 3 – Using the Go To Special Tool to Clear Content in Excel Without Deleting Formatting

Steps:

  • Press the F5 key on your keyboard.
  • The Go To window will appear.
  • Click on the Special… button in the window.

Go To Window

  • The Go To Special window will appear.
  • Check the Constants option from the Select group and click on the OK button.

Go To Special Window

  • All the cells of the Excel file will be selected.
  • Press the Del / Delete key on your keyboard.

Press Del/Delete Key to Clear Contents in Excel Without Deleting Formatting


Method 4 – Applying VBA Macro to Clear Content Without Deleting Formatting

Steps:

  • Go to the Developer tab and select Visual Basic.

Access the Visual Basic Tool

  • The Microsoft Visual Basic for Applications window will appear.
  • Select Sheet 5 from the VBAProject group.
  • A code window will appear on the right side.
  • Insert the following code and press Ctrl + S.
Sub ClearContentsExceptFormatting()
Range("B4:F9").ClearContents
End Sub

Microsoft Visual Basic for Applications Window

  • A Microsoft Excel dialogue box will appear.
  • Click on the No button in this dialogue box.

Microsoft Excel Dialogue Box

  • The Save As window will appear.
  • Choose the Save as type: option as .xlsm file and click on the Save button.

Save the Excel as .xlsm File to Enable Macro

  • Close the code window.
  • Go to the Developer tab and click on Macros.

Access the Macros Tool

  • The Macro window will appear.
  • Choose the Sheet5.ClearContentsExceptFormatting macro and click on the Run button.

Run the Macro to Clear Contents in Excel without Formatting

  • Here are the results.

Cleared Contents in Excel Without Deleting Formatting


Download the Practice Workbook


Related Articles


<< Go Back to Clear Contents in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Tanjim Reza
Tanjim Reza

Md. Tanjim Reza Tanim, a BUET graduate in Naval Architecture & Marine Engineering, contributed over one and a half years to the ExcelDemy project. As an Excel & VBA Content Developer, he authored 100+ articles and, as Team Leader, reviewed 150+ articles. Tanim, leading research, ensures top-notch content on MS Excel features, formulas, solutions, tips, and tricks. His expertise spans Microsoft Office Suites, Automating Finance Templates, VBA, Python, and Developing Excel Applications, showcasing a multifaceted commitment to the... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo