I have a range from A1 to F4.
I want to clear contents of the cells in range if is is other than "B"
Whats wrong eith following code?
Sub Deletecell()
Dim R As Range
Set R = Worksheets("sheet1").Range("A1:F4")
For Each Cell In R
If Cell.Value <> "B" Then
Cell.Value.ClearContents
Next
Else
End Sub
I want to clear contents of the cells in range if is is other than "B"
Whats wrong eith following code?
Sub Deletecell()
Dim R As Range
Set R = Worksheets("sheet1").Range("A1:F4")
For Each Cell In R
If Cell.Value <> "B" Then
Cell.Value.ClearContents
Next
Else
End Sub