Maybe my copy's defective and yours isn't.
Your copy is just fine.
Selected "Record Macro" tab
You no longer need to record a macro, I am giving you the entire code. Open up the Visual Basic Editor. Right click on "ThisWorkbook" -> Insert -> Module. Paste the code below into the new module. Back in Excel, on the ribbon under the Developer Tab, click macros then run the macro "Create_Data". Should do what you are asking
Sub Create_Data()
Dim ws As Worksheet: Set ws = Sheets("Sheet1") 'you may need to change this to match your sheet
Dim LR As Long
'//Note: In your example column F appeared to be green values in column A. G = column E, H = A, I = D.
'// establish last used row and turn off screen updating
Application.ScreenUpdating = False
LR = ws.Range("A" & Rows.Count).End(xlUp).Row
'// clear existing data in columns F:I
ws.Range("F4:I" & LR).ClearContents
'// autofilter by colors according to example spreasheet provided. User defined colors appear to be Green: RGB(198, 239, 206) & Red: RGB(255, 199, 206)
With ws
.AutoFilterMode = False
.Range("A1:A" & LR).AutoFilter 1, RGB(198, 239, 206), xlFilterCellColor
.AutoFilter.Range.Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy .Range("F4")
.AutoFilterMode = False
.Range("E1:E" & LR).AutoFilter 1, RGB(198, 239, 206), xlFilterCellColor
.AutoFilter.Range.Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy .Range("G4")
.AutoFilterMode = False
.Range("A1:A" & LR).AutoFilter 1, RGB(255, 199, 206), xlFilterCellColor
.AutoFilter.Range.Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy .Range("H4")
.AutoFilterMode = False
.Range("D1:D" & LR).AutoFilter 1, RGB(255, 199, 206), xlFilterCellColor
.AutoFilter.Range.Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy .Range("I4")
.AutoFilterMode = False
End With
'// turn on screen updating
Application.ScreenUpdating = True
End Sub
Bookmarks