FaizanRoshan
Board Regular
- Joined
- Jun 11, 2015
- Messages
- 54
Hi,
I use this code for fill row cells with color thats value is "Yes" based on another cell color.
Actually this code only fill one row at one time with special color.
i want code that will fill out all row cell that value is "yes" base on special color for each row.
Like: code fill row cell Range(m2:ac2) with color based on color cell "G2"
so if code fill row Range(m4:ac4) its color must be form cell "G4" and so on.
Is this possible using vba.
Here is code:
Sub Graph()
1 Column = Range("m" & Columns.Count).End(xlToRight).Column
Set MR = Range("M2:AC10000" & Row)
For Each cell In MR
If cell.Value = "Yes" Then cell.Interior.ColorIndex = Range("G2").Interior.ColorIndex
Next
End Sub
I have no experience wrting <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym>.
Thanks in advance for your help!
I use this code for fill row cells with color thats value is "Yes" based on another cell color.
Actually this code only fill one row at one time with special color.
i want code that will fill out all row cell that value is "yes" base on special color for each row.
Like: code fill row cell Range(m2:ac2) with color based on color cell "G2"
so if code fill row Range(m4:ac4) its color must be form cell "G4" and so on.
Is this possible using vba.
Here is code:
Sub Graph()
1 Column = Range("m" & Columns.Count).End(xlToRight).Column
Set MR = Range("M2:AC10000" & Row)
For Each cell In MR
If cell.Value = "Yes" Then cell.Interior.ColorIndex = Range("G2").Interior.ColorIndex
Next
End Sub
I have no experience wrting <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym>.
Thanks in advance for your help!