Hello, I am trying to use a button to clear 2 ranges of cells within the active worksheet, but without deleting the formulas that are in those cells
I picked the code from different sources, and tried to make it work, but I am struggling a lot.
Help please
Sub ClearContent()
Dim val As Range
Dim r1 As Range, r2 As Range
Set r1 = ThisWorkbook.ActiveSheet.Range("V4:V19")
Set r2 = ThisWorkbook.ActiveSheet.Range("A68:U121")
Set val = Sheet1.r1.SpecialCells(xlCellTypeConstants)
Set val = Sheet1.r2.SpecialCells(xlCellTypeConstants)
On Error Resume Next
val.ClearContents
End Sub
Bookmarks