Change colours within colour range to specific colour

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Change colours within colour range to specific colour

Post by Rudi »

Hi,

Is there an efficient way to do something like this:

In all sheets within a workbook,
Convert all fill colours in the range RGB(0,0,255) through to RBG(0,255,255)
To be RGB(51,102,255)

Does that make sense??
TX
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Change colours within colour range to specific colour

Post by HansV »

I'm afraid you'd have to loop:

Code: Select all

    Dim i As Long
    For i = 0 to 255
        ' Search for RGB(0, i, 255) and change to RGB(51, 102, 255)
    Loop
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Change colours within colour range to specific colour

Post by Rudi »

TX...
Just throwing it out there to see what comes back.
Was hoping for some kind of extraordinary trick!

Cheers
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Change colours within colour range to specific colour

Post by HansV »

Although the For i = 0 To 255 loop is cumbersome, it's still much better than looping through all 17,179,869,184 cells of each sheet and check whether its fill color is in the desired range. We can't restrict ourselves to the used range of a sheet, for cells outside the used range can have their fill color set too...
Best wishes,
Hans