View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Cycle through each row and look for string in each cell

The 1 tells it to start looking at the first character.
vbTextCompare tells it to make a text comparison, which is not case
sensitive.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"matpj" wrote in
message ...

hi,

thanks for the code!
it works like a charm!

I amended it to bold the entire row:

(not sure how to make a code winod in this forum)

i = 1:
Do
If InStr(1, Cells(i, 1).Value, "Total", vbTextCompare) < 0
Then
Cells(i, 1).EntireRow.Font.Bold = True
End If
i = i + 1
Loop Until Cells(i, 1).Value = ""



out of interest, can you explain the parameters in the InStr function.
I understand what the Cells(i,1).Value does, but the vbTextCompare i've
never come across, and the first '1' in the InStr...

thanks very much,

Matt


--
matpj
------------------------------------------------------------------------
matpj's Profile:

http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=513103