View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Héctor Miguel Héctor Miguel is offline
external usenet poster
 
Posts: 434
Default Macro to show which cells have validation

also, is some validation cells are empty, Melina's suggestion could add a second procedure
(but this time) choosing "empty cells" prior to apply any color

of course, this shall be done one by one, or...
combine the proposals with code and a looping (as per the last paragraph in OP)
(the on error resume next line is... "just in case" no validation cells are in a worksheet) ;)

regards,
hector.

Rick Rothstein wrote in message ...
By way of clarification... I just looked at Melina's posting which does what your opening sentence says and locates *all* cells with validation (whether they have anything in them or not) and colors them purple. I picked up on what you said later on when you mentioned "stray cells" that have
nothing in them except validation... that is what my code locates (it preserves any cells with something in that along with their validation). Of course, if all the cells are empty, my code and Melina's code will locate the same set of cells. So, which you should use kind of depends on what you
actually meant.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message ...
You should be able to do it with this single line of code (just change my example worksheet reference of Sheet3 to your own worksheet's name)...

Worksheets("Sheet3").UsedRange.SpecialCells(xlCell TypeAllValidation). _
SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 18

--
Rick (MVP - Excel)


"Lostguy" wrote in message ...
Hello!

Anyone know a code to go through the active sheet, look for any cells
that have validation, and shade them purple? I am modifying an older
workbook, and there are stray cells with no data or formula, just
validation, so I am trying to track them down.

I guess a "For each ws in Workbook" code would be easier.

Thanks for any help!

VR/

Lost