Highlight cells where the last charcter in the cell is a blank

P

Pat

Hi All,

If anyone knows the answer to this one without putting themselves out,
I would be very grateful.

I have a load of entries in column A (A1:A2000) and some of the cells
contain a blank character at the end.

Just wondering if those cells with a blank character as the last
character can be highlighted by running a formula or macro?

Many thanks in advance,

Cheers,

Pat
 
F

Fred Smith

You want conditional formatting (in the Format menu).

Check for Right(a1,1)=" " and then format the cell however you want (eg,
background color).

Post back if you need more help.

Regards,
Fred.
 
P

Pete_UK

By "blank" character, do you mean a space or a non-breaking space
character (code 160) or some-such ?

Pete
 
P

Pat

Hi,

Yes. I mean just an actual space " "

I guess it might start something like IF(Right(a1,1)=" ", then format
the cell to colour "yellow")

Thanks again,

Cheers,

Pat
 
P

Pete_UK

Pat,

Highlight all the cells A1:A2000, then click on Format | Conditional
Formatting and in the panel that pops up choose Formula Is rather than
Cell Value Is in the first box. In the second box enter this formula:

=RIGHT(A1,1)=" "

then click on the Format button, slect the Patterns tab (for
background) then click on Yellow. Click OK twice to exit the CF
dialogue, then you should have what you want applied to all the
highlighted cells.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top