EXCEL: Deleting cell range (multiple sheets) [Closed]

Report
-
Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
-
Hi,

I have been trying to figure out how to clear the contents of specified cell, say

Range (A12:U12).Select
ActiveCell.End(xlDown).Select
Selection.ClearContents

from n number of worksheets in 1 workbook.

I have tried using For loop but it only clears the selected sheet.

Is there a quicker solution to resolve this?

Thank you very much.

1 reply

Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
793
try this macro
Sub test()
Dim j As Integer, k As Integer
j = Sheets.Count

For k = 1 To j
With Sheets(k)
.Range("a1:F1").Clear
End With
Next k
End Sub


I have chosen range("a1:F!").modify this line to suit you
"clearcontents" will clear contents only but not the formulas and formats
i

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!