youngbella
New Member
- Joined
- Sep 27, 2020
- Messages
- 19
- Office Version
- 2010
- Platform
- Windows
Hi, basically I have this table range.
I want to color the cells that are "0" but have length and serial number. but do nothing if don't have both conditions.
i tried but it turns out all cells with "0" is colored even the conditions not met.
I'm new with VBA. Still trying. glad if you could help.
View attachment 23426
I want to color the cells that are "0" but have length and serial number. but do nothing if don't have both conditions.
i tried but it turns out all cells with "0" is colored even the conditions not met.
I'm new with VBA. Still trying. glad if you could help.
View attachment 23426
VBA Code:
Sub findzeroandcolor()
Dim findme As Range
For Each findme In Range("A:I")
If (findme = "0") And (findme.Offset(, -1) <> "") Then
findme.Interior.ColorIndex = 6
End If
Next findme
End Sub