Can anyone tell me which command would find a certain word in a range, then change it's color please?
Can anyone tell me which command would find a certain word in a range, then change it's color please?
Hi,
Try this:
Please Login or Register to view this content.
Rule 1: Never merge cells
Rule 2: See rule 1
"Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".
Thanks sweep! That looks like it should work, but I'm getting an error
when I try it (with some adjustments to fit the code I'm trying out here.) :
I'm getting the error: "Object variable or With block variable not set" on the line: rCell = Cells(lRow, 1).Value.Please Login or Register to view this content.
If I Dim rCell as a variant, I get the error "Object required" on the line:
"If InStr(rCell.Value, finder) > 0 Then"
Am I making some glaring mistake somewhere here please?
rCell is a range object and requires the Set command to make the assignment
Please Login or Register to view this content.
Hi,
The mistake that you are making is that you are declaring rCell as range and then you are using it as a string..
Try this code instead
HTH,Please Login or Register to view this content.
Vaibhav
Last edited by c.vaibhav; 05-13-2009 at 02:30 AM.
Thanks for that guys! Works fine now
I assume btw that it will work similarly if I make 'finder' an
array of values, so I can change the color of multiple words using
this code? (I'm doing this as an exercise to color my code before
printing it out.) I'll test that out later anyway as it's nearly
midnight here now
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks