Hi all,
I can't run this macro.
I should clear the contents of a few sheets in the range ( J16 : J215 ) if the cell doesn't contain the character "X" .
sheets control start from number 7 .
Who can help me?
Thanks.
I can't run this macro.
Code:
Sub cancel()
Dim WS_Count As Integer
Dim i As Integer
Dim rng As Range
Dim cell As Variant
WS_Count = ActiveWorkbook.Worksheets.Count
Set rng = Sheets(i).Range("j16:j215")
For i = 7 To WS_Count
For Each cell In rng
If cell.Value <> "X" Then
cell.ClearContents
End If
Next
Next i
End Sub
I should clear the contents of a few sheets in the range ( J16 : J215 ) if the cell doesn't contain the character "X" .
sheets control start from number 7 .
Who can help me?
Thanks.