Thread: Format
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default Format

That was pretty much what I suggested ... ;-)

--

Vasant


wrote in message
...
I had to use the code...


If InStr(1, .Offset(, -
1).Value, "Percent") Or _
InStr(1, .Offset(, 1).NumberFormat, "%")
Or _
InStr(1, .Offset(, 2).NumberFormat, "%")
Or _
InStr(1, .Offset(, 3).NumberFormat, "%")
Then
.Value = "percent"


-----Original Message-----
Add:

Or _
InStr(1, .Offset(, -1).NumberFormat, "%")

to your code.

--

Vasant

"Todd Huttenstine"

wrote in message
...
Below is a code that looks in columns P,Q, and R and if

it
finds the character "%" will put the value "percent" in
the cell in columnO. I would also like the code to also
look for another condition. That is I want it to look

in
the cell in ColumnN and if it finds the value "percent"
anywhere in that cell, will also put the value "percent"
in the cell in columnO.


Dim c As Range
For Each c In Range("O2:O100").Cells
With c

If InStr(1, .Offset(,
1).NumberFormat, "%") Or _
InStr(1, .Offset(, 2).NumberFormat, "%")
Or _
InStr(1, .Offset(, 3).NumberFormat, "%")
Then
.Value = "percent"



.