How do I use the “Clear Sheet/Range/Table” activity, to clear some data in a range of cells, without clearing the formatting of the cells?
1 Like
Sub ClearRangeContents()
Dim ws As Worksheet
Dim rng As Range
' Specify the sheet name and range here
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change to your sheet name
Set rng = ws.Range("A1:C10") ' Change to your desired range
' Clear the contents of the range without affecting the formatting
rng.ClearContents
End Sub
Use invoke vba activity
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.