Some correction in vba.

FaizanRoshan

Board Regular
Joined
Jun 11, 2015
Messages
54
Hi,
Here is code.

Sub Graph()1 Column = Range("m" & Columns.Count).End(xlToRight).Column

Set MR = Range("C2:S20" & Row)
For Each cell In MR
If cell.Value = "Yes" Then cell.Interior.ColorIndex = Range("PartsData!G2").Interior.ColorIndex


Next
End Sub

I use this code in excel for cell fill with color based on another cell color.
This code fill cell with color from "C2:S20" base on "G2" cell color.
Now i want to some change in code, so that code will fill cell color base on special color for each row cell.
like: For row "C3:C3" and cell color "G3" and row "C5:C5" with fill base on "G5" cell color.
Please help me to solve this issue ASAP.

Thanks advance for Help!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,207,391
Messages
6,078,215
Members
446,321
Latest member
thecachingyeti

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