Forum Discussion
A_SIRAT
Oct 18, 2023Iron Contributor
Please help with a simple VBA Macro
Hi, I have a file that I would like to have a macro that will clear the contents of cells E18:F19 on all the sheets except the first sheet named " Action". I have sampled two sheets but they coul...
- Oct 18, 2023
Like this:
Sub ClearData() Dim wsh As Worksheet Application.ScreenUpdating = False For Each wsh In Worksheets Select Case wsh.Name Case "Action" ' Skip sheet Case Else wsh.Range("E18:F19").ClearContents End Select Next wsh Application.ScreenUpdating = True End Sub
HansVogelaar
Oct 18, 2023MVP
Like this:
Sub ClearData()
Dim wsh As Worksheet
Application.ScreenUpdating = False
For Each wsh In Worksheets
Select Case wsh.Name
Case "Action"
' Skip sheet
Case Else
wsh.Range("E18:F19").ClearContents
End Select
Next wsh
Application.ScreenUpdating = True
End Sub
- A_SIRATOct 19, 2023Iron ContributorThank you!