Code:
Sub GatherInfoHimchanLooping()
Dim exclude As String
Dim endrow As String: endrow = Sheets("Info").Range("E100").End(xlUp).Row
Dim Finalrow As String: Finalrow = Sheets("Info").Range("I100").End(xlUp).Row
For i = 24 To endrow
exclude = Cells(i, 5).Value
Sheets("Data").Select
LastRowColumnA = Cells(Rows.Count, 1).End(xlUp).Row
ActiveSheet.Range("$A$1:$O$" & LastRowColumnA ).AutoFilter Field:=2, Criteria1:= _
exclude, Operator:=xlAnd
On Error Resume Next
Range("O2:O" & LastRowColumnA ).SpecialCells(xlCellTypeVisible).Value = "x"
'Selection.Value = "x"
ActiveSheet.ShowAllData
Sheets("Info").Select
Next i
End Sub
Hi guys, this loop is trying to see info tab and anything matches in I column in column 2 in data tab, I will mark x in column O.
However, I am having a problem with my loop. seems like my loop is ignoring variables(endrow, Finalrow) while looping.
Also instead of making column O to mark x, how can I delete the filtered criteria right away?
Any advice helps!
Thank you