Related:
- I need VBA help please!!!
- Vba case like - Guide
- Number to words in excel formula without vba - Guide
- Vba check if value is in array - Guide
- Vba color index - Guide
- How to open vba in excel - Guide
1 response
Hope this helps!
Sub CheckColor()
Dim i
Dim LastRow
i = 1
LastRow = Range("A65536").End(xlUp).Row
For i = i To LastRow
If Range("A" & i).Interior.ColorIndex = 10 Then
Range("B" & i).Select
With Selection.Interior
.ColorIndex = 10
.Pattern = xlSolid
End With
ElseIf Range("A" & i).Interior.ColorIndex = 3 Then
Range("B" & i).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
ElseIf Range("A" & i).Interior.ColorIndex = xlNone Then
Range("B" & i).Select
With Selection.Interior
.ColorIndex = xlNone
End With
End If
Next i
Range("A1").Select
End Sub
Sub CheckColor()
Dim i
Dim LastRow
i = 1
LastRow = Range("A65536").End(xlUp).Row
For i = i To LastRow
If Range("A" & i).Interior.ColorIndex = 10 Then
Range("B" & i).Select
With Selection.Interior
.ColorIndex = 10
.Pattern = xlSolid
End With
ElseIf Range("A" & i).Interior.ColorIndex = 3 Then
Range("B" & i).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
ElseIf Range("A" & i).Interior.ColorIndex = xlNone Then
Range("B" & i).Select
With Selection.Interior
.ColorIndex = xlNone
End With
End If
Next i
Range("A1").Select
End Sub