Clear contents across multiple sheets for constant Range

Mohamedazees

New Member
Joined
Oct 18, 2020
Messages
43
Office Version
  1. 2019
Platform
  1. Windows
Dear Sir,

I need an Excel Macro to clear the contents from Sheet2 to Sheet2o, In the said worksheets I have Tables and the tables headers starting from Range A3 in all sheets and so on

I what to clear the contents of used ranges of all the sheets tables from Sheet2 to Sheet 20 except headers.

Thanks In advance

A.Mohamed
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
You could try as below:
VBA Code:
Sub test()
    Dim x As Long
    
    For x = 2 To 20
        Sheets(x).ListObjects(1).DataBodyRange.ClearContents
    Next x
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,882
Messages
6,127,530
Members
449,385
Latest member
KMGLarson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top