VBA to Color Cells

Nunzy83

New Member
Joined
Mar 22, 2013
Messages
3
Hi,

I am trying to create a VBA to:

1. Search workbook for a specific values and then to color that cell with a corresponding color.

2. Search workbook for a specific values and then color other cells underneath (the next 3 merged rows after the cell containing the value) with a corresponding color.

I know I am being vague but I need a starting point.

Thanks
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I am trying to create a VBA to:

1. Search workbook for a specific values and then to color that cell with a corresponding color.

2. Search workbook for a specific values and then color other cells underneath (the next 3 merged rows after the cell containing the value) with a corresponding color.

I know I am being vague but I need a starting point.
A little too vague I'm afraid...

1) Are the values you are searching for constants or formula results?

2) Are you search for a single word each time the macro will be executed or do you have a list of words? If a list, where is this list at?

3) To be clear, you want to search the entire workbook for the values, not just a single worksheet, right?

4) Can the value you are searching for exist more than once within the worksheet/workbook?

5) Do the values you are searching for occupy the entire cell they are in or can there be other text mixed in the cell with them?

6) Are your merged cells physically merged on the worksheet (so that they look/act like a single cell)?
 
Upvote 0
A little too vague I'm afraid...

1) Are the values you are searching for constants or formula results?
Both
2) Are you search for a single word each time the macro will be executed or do you have a list of words? If a list, where i s this list at?
A list. I was just going to list of words in the macro.
3) To be clear, you want to search the entire workbook for the values, not just a single worksheet, right?
Correct. I have 5 sheets total. With info being shared across them all. So which ever is easier.
4) Can the value you are searching for exist more than once within the worksheet/workbook?
Yes
5) Do the values you are searching for occupy the entire cell they are in or can there be other text mixed in the cell with them?
Occupy the entire cell.
6) Are your merged cells physically merged on the worksheet (so that they look/act like a single cell)? Yes
Visio took a dump on me so I am using Plan B, and more reliable Excel to develop a floor plan for work. I have one floor per worksheet and I basically drew the floor layout. Each cube or office is represented by a square containg the seat number, followed by the occupants name and then name of the occupants manager. The data containing the names is derived from look ups on a separate tab in the work book. My first vision is for the seat number to be a color depending on what department that seat is assigned to. This is were is where I need to assign a list in point 2 above. OR another thought I just got is that the seat number color is derived from a look up of the department name from the data tab. My second vision is that the cell containing the occupants managers (based on the look up) gets colored. So if eg. manager is John Smith that cell showing John Smith would be blue. I would submit a screen shot but its a compliance thing......sorry I hope I didn't overload!
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top