Hi all,
So, I want the macro to check the background color in Column A jump to the next cell in Column B and write whatever Value is assigned to it..
so if the background color is yellow i want the next column to say "Bi-monthly" etc.
You can find the other colors and their value in the top part of the attached file
I have tried my level best but I don't have exact color.index value for most of the colors so I was trying to use RGB as a reference but failing at that too..
here is the code so far:
Sub ani()
Application.ScreenUpdating = False
Dim LR As Long, I As Integer
I = 1
LR = Range("A" & Rows.Count).End(xlUp).Row
Do While I < LR
If Cells(I, 1).Interior.ColorIndex = 6 Then
Cells(I, 1).Select
Cells(I, 1).Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "Bi-Monthly"
End If
If Cells(I, 1).Interior.ColorIndex = 6 Then
Cells(I, 1).Select
Cells(I, 1).Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "Monthly"
End If
If Cells(I, 1).Interior.ColorIndex = 6 Then
Cells(I, 1).Select
Cells(I, 1).Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "Weekly"
End If
If Cells(I, 1).Interior.ColorIndex = 5 Then
Cells(I, 1).Select
Cells(I, 1).Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "Registration Fee"
End If
If Cells(I, 1).Interior.ColorIndex = 6 Then
Cells(I, 1).Select
Cells(I, 1).Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "Miscellaneous Charge"
End If
I = I + 1
Loop
End Sub
Bookmarks