loop 4 column

MR3

Board Regular
Joined
Jun 10, 2008
Messages
175


i would like to write a loop that goes through column A data and says if its RED then go and change the interior color of that corresponding row(s) column G of that particular Row red as well.

After vba script (outcome I would like)
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try...
Code:
Sub red()
With Application
    .ScreenUpdating = False
    For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
        Set A_Rng = Range("A" & i)    'Change range to suit yours
        Set F_Rng = Range("F" & i)    'Change range to suit yours
        Select Case A_Rng.Interior.ColorIndex
            Case 3
                F_Rng.Interior.ColorIndex = 3
            Case Else
        End Select
    Next
    .ScreenUpdating = True
End With
End Sub
 
Upvote 0
Code:
Sub ColorColumnG()
Dim cell As Range
    LR = Range("A" & Rows.Count).End(xlUp).Row
    MyColor = 3
    For Each cell In Range("$A$1:A" & LR)
        If cell.Interior.ColorIndex = MyColor Then cell.Offset(0, 6).Interior.ColorIndex = MyColor
    Next cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,153
Members
452,891
Latest member
JUSTOUTOFMYREACH

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