Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selecting cells by their colour 2

Status
Not open for further replies.

Rybrookar

Technical User
Jun 2, 2007
27
GB
I'm sure i seen this tip somewhere but can't find it.

I want to select cells on a workbook that are highlighted yellow so i can unprotect them, as they will be input cells.

How do i do this?

thanks
 
How are the cells highlighted ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
For each c in selection
if c.interior.colorindex = x then
c.locked = false
end if
next

where x is the colorindex for the specific yellow that you have

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
They're highlighted yellow by using the cell fil on tool bar
 
xlbo

worked perfectly. This is actually a very good little bit of code that will save me hours.

Thanks
 
btw - the reason PHV was asking that question (and I should've asked myself) is that if a cell is coloured by the conditional formatting applied to a cell, the routine I posted won't work as the interior.colorindex does not get changed by the conditional formatting

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top