Hello,
I use the code below to check a range of cells. If true then add "X99%" to text in cell "repsym". Problem is, sometimes the range has more than one cell that returns a true value. Then cell "repsym" has several "X99%" added to text.
How to check a range, and if one or several return a true value, then only one response.
Thanks
Tom
Strangely, I would get error code "End if without if". I removed the end if and it works albeit incorrectly with all the extra "X99%".
I use the code below to check a range of cells. If true then add "X99%" to text in cell "repsym". Problem is, sometimes the range has more than one cell that returns a true value. Then cell "repsym" has several "X99%" added to text.
How to check a range, and if one or several return a true value, then only one response.
Thanks
Tom
Code:
For Each cell In Range("GraphSampAvg").Cells
If cell.Value <= (Range("Lot99WVal") / 2) Then _
Range("repsym").Select
With Selection
.Value = Range("repsym") & " X99%"
.Interior.Color = vbBlack
.Font.Color = vbWhite
End With
Next
Strangely, I would get error code "End if without if". I removed the end if and it works albeit incorrectly with all the extra "X99%".