Help with Cell Color Change Macro

Merlin610

New Member
Joined
Apr 30, 2013
Messages
2
I need help with a macro that changes the color of a cell column range depending on the words in a cell out of the range.

For example, if B12="JSP-MIC" the color of B13-B19 should be yellow,
If B12="JSP-AOUT" the color of the range should be green,
If B-12=". . ." the color of the range should be grey.

There are additional values for B12, but those are the only three colors.

I have started several times, but I am getting nowhere fast.

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I need help with a macro that changes the color of a cell column range depending on the words in a cell out of the range.

For example, if B12="JSP-MIC" the color of B13-B19 should be yellow,
If B12="JSP-AOUT" the color of the range should be green,
If B-12=". . ." the color of the range should be grey.

There are additional values for B12, but those are the only three colors.

I have started several times, but I am getting nowhere fast.

Thanks
Is this code helping you??
Code:
Sub ColorRange()
Select Case Range("B12").Value
Case "JSP-MIC"
Range("B13:B19").Interior.Color = vbYellow
Case "JSP-AOUT"
Range("B13:B19").Interior.Color = vbGreen
Case ". . ."
Range("B13:B19").Interior.Color = 46
End Select
End Sub
ZAX
 
Upvote 0

Forum statistics

Threads
1,214,992
Messages
6,122,631
Members
449,095
Latest member
bsb1122

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