change colorindex 26 to 35 in a spreadsheet

I want an efficient macro that looks an entire sheet for cells with colorindex26 and changes the colors of these cells to color index 35

Thank you.
AiyshaAsked:
Who is Participating?
 
mvidasConnect With a Mentor Commented:
Hi Aiysha,

Unfortunately there is no efficient way to search for colorindex, you do have to loop through the cells to determine the colorindex.

However, there is a workaround, that stays with the individual workbooks.  Probably not what you're looking for here, but is the only way to do it other than looping.  You can change what colorindex 26 refers to for that workbook:
 YourWorkbook.Colors(26) = YourWorkbook.Colors(35)

Matt
0
 
tushar_compConnect With a Mentor Commented:

hi,
i think u should try CONDITIONAL FORMATTING
u will get what u want .. i hope
if it works le me know

Tushar
0
 
AiyshaAuthor Commented:
Tushar_comp,

Even if you do conditional formatting, you would still have to visit each and every cell in the spreadsheet. I agree with mvidas there is no efficient way of doing this task.

0
 
tushar_compCommented:
ya,

aggree
even if u  use conditional formating
the operation will be cell-by-cell
but it will be one line formula that will do ur job  else
u will have to write loops for that ,
if i am wrong correct me
as i don't have that much experience in EXCEL vba

Thanks
Tushar
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.