rltomalin
asked on
How to return the colour of a cell
Hello
I have a bit of code that works fine - as follows:
************************** ********** ********** ***
Sheet1.Unprotect
For Each rngCell In Sheet1.Range("listing")
If Not rngCell.Locked And Not IsEmpty(rngCell.Value) Then
rngCell.Locked = True
rngCell.Interior.Color = RGB(200, 200, 200)
intN = intN + 1
End If
Next rngCell
Sheet1.Protect
************************** ********** ********** *****
This looks in a range and finds any unlocked cells with content and then locks and colours them.
In another routine, I would like to do a similar thing, but instead of looking for the locked status I would like to look for a specific cell colour (or NOT a specific cell colour).
Is there a statement that would do that please?
Regards
Richard
I have a bit of code that works fine - as follows:
**************************
Sheet1.Unprotect
For Each rngCell In Sheet1.Range("listing")
If Not rngCell.Locked And Not IsEmpty(rngCell.Value) Then
rngCell.Locked = True
rngCell.Interior.Color = RGB(200, 200, 200)
intN = intN + 1
End If
Next rngCell
Sheet1.Protect
**************************
This looks in a range and finds any unlocked cells with content and then locks and colours them.
In another routine, I would like to do a similar thing, but instead of looking for the locked status I would like to look for a specific cell colour (or NOT a specific cell colour).
Is there a statement that would do that please?
Regards
Richard
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That works fine
Richard