Thread: Code Edit
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Todd Huttenstine[_2_] Todd Huttenstine[_2_] is offline
external usenet poster
 
Posts: 237
Default Code Edit

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