PDA

View Full Version : Only highlight wrongly capitalized



grichey
09-27-2010, 12:09 PM
Hello - I'm trying to make a macro to only highlight wrongly capitalized cells. I have attached an an example. All instances of NM should be NM, not nm, Nm, or nM. I don't want it to actually change it in case there is some reason I actually want it that way, I just want to high light it so I can review the potential error. I've tried using the macro someone posted on the word forum but cannot figure out how to make it work as it doesn't take into account capitalization ie to word nm=NM=nM=Nm.


word thread: http://www.vbaexpress.com/forum/showthread.php?t=33793

ideas?

p45cal
09-27-2010, 01:53 PM
I doubt there's a need for a macro; Select the cells C8:L8, get to the conditional formatting dialogue, then in xl2007 up, use the 'Use a formula to determine which cells to format', and in versions before that, use the FormulaIs: option in the dropdown.
Enter
=NOT(EXACT(C8,UPPER(C8)))
choose a format and OK out.

grichey
09-27-2010, 01:59 PM
I'm trying to use a macro as it's part of a larger project to have a long list of typos to check for and i'd be using it on lots of work books.

p45cal
09-27-2010, 02:28 PM
For Each cll In Range("C8:L8")
If cll.Value <> UCase(cll.Value) Then cll.Interior.ColorIndex = 3
Next cll

grichey
09-27-2010, 02:33 PM
thanks I'll give it a try in the morning.