Code Edit

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

I have Range O2:O100 and P2:R100. The below code
currently looks in Range P2:P100 and if it finds a % in
the value,
will offset into the corresponding cell in Range O2:O100
and will put the % character in the cell itself.

Instead of the code only looking in Range P2:P100 for a %
in the value, I would like for the code to look in the
range expanded to P2:R100 for a % in the value.


Dim c As Range
For Each c In Range("O2:O100").Cells
With c
If InStr(1, .Offset(,
1).NumberFormat, "%") Then
.Value = "percent"
Else
.Value = "number"
End If
End With
Next c
 
If InStr(1, .Offset(, 1).NumberFormat, "%") or _
InStr(1, .Offset(, 2).NumberFormat, "%") Then
 
Back
Top