Hi everyone! I have a question here. I have two sheets, one of them contains the whole information (in my case a table with many rows and columns) and the second one is a macro where it shows how many times a value has repeated itself in the master sheet. The idea is to take the value shown in the cell in the second sheet (showing how many times a value is duplicated) and filter it in the master sheet to show only the cells containing this value. Then it goes to the second one in the duplicates sheet and so on until the end. The idea is that after the filter is done I run a separate macro on the results that are left. I can imagine that I need a for loop but not sure how to combine it with the filter. To understand better lets say we have in the duplicates sheet:
colA colB
abc 3
cvb 4
zxc 5
We take the first value (abc) here filter it in the master sheet, then goes to the second value (cvb) and so on until the end of the column (which would be unknown). What would the for loop syntax be? For the filter I use the following:
Sub Filter_CellValue1()
Sheets("inventory).Range("A1").AutoFilter field:=2, Criteria1:=Sheets("duplicates").Cells(2, 1).Value
End Sub
colA colB
abc 3
cvb 4
zxc 5
We take the first value (abc) here filter it in the master sheet, then goes to the second value (cvb) and so on until the end of the column (which would be unknown). What would the for loop syntax be? For the filter I use the following:
Sub Filter_CellValue1()
Sheets("inventory).Range("A1").AutoFilter field:=2, Criteria1:=Sheets("duplicates").Cells(2, 1).Value
End Sub