?
Solved

change colorindex 26 to 35 in a spreadsheet

Posted on 2006-05-10
4
Medium Priority
?
410 Views
Last Modified: 2013-12-25
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.
0
Comment
Question by:Aiysha
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
mvidas earned 1800 total points
ID: 16649709
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
 
LVL 1

Assisted Solution

by:tushar_comp
tushar_comp earned 200 total points
ID: 16657678

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

Tushar
0
 

Author Comment

by:Aiysha
ID: 16658562
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
 
LVL 1

Expert Comment

by:tushar_comp
ID: 16660137
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question