Hello, i use excell 2010
My conditional formatting so far will color code names e.g. all cells that say mike have a blue fill color.... no problem that was easy.
But i need the cells to the left of my names column to have the same fill color, e.g. cell f2 is blue and says mike, and i want e2 to recognize that the cell is blue in the adjacent cell and fill its self with the same color. e2 will have a calculated % value.
here is the code i have so far but i keep getting object required, any advise?!
Sub copyValuesAndFormats()
Dim intRow As Integer
Dim rngCopy As Range
Dim rngPaste As Range
'Loop from Rows 1 through 35
For intRow = 1 To 35
'Set the copy and paste range
'CHANGE THE SHEET TO MATCH YOURS
Set rngCopy = DataInColumn.Range("F" & intRow + 1)
Set rngPaste = DataInColumn.Range("E" & intRow + 1)
'Test to see if rows have a value
If rngCopy.Text <> "" Then
'Since it has a value, copy the value and color
rngPaste.Interior.Color = rngCopy.Interior.Color
'If you wish to copy the color of the font as well, uncomment the next line
'rngPaste.Font.Color = rngCopy.Font.Color
End If
Next intRow
End Sub
My conditional formatting so far will color code names e.g. all cells that say mike have a blue fill color.... no problem that was easy.
But i need the cells to the left of my names column to have the same fill color, e.g. cell f2 is blue and says mike, and i want e2 to recognize that the cell is blue in the adjacent cell and fill its self with the same color. e2 will have a calculated % value.
here is the code i have so far but i keep getting object required, any advise?!
Sub copyValuesAndFormats()
Dim intRow As Integer
Dim rngCopy As Range
Dim rngPaste As Range
'Loop from Rows 1 through 35
For intRow = 1 To 35
'Set the copy and paste range
'CHANGE THE SHEET TO MATCH YOURS
Set rngCopy = DataInColumn.Range("F" & intRow + 1)
Set rngPaste = DataInColumn.Range("E" & intRow + 1)
'Test to see if rows have a value
If rngCopy.Text <> "" Then
'Since it has a value, copy the value and color
rngPaste.Interior.Color = rngCopy.Interior.Color
'If you wish to copy the color of the font as well, uncomment the next line
'rngPaste.Font.Color = rngCopy.Font.Color
End If
Next intRow
End Sub