This is what I do and want:
I want to run a macro to filter my data which is located in cell (D), when the data is filtered I copy some stats that are contained in 9 different cells, then paste only the values to the right of the filtered data cell (D), after that I clear the filter and select the next cell (to the bottom) to be able to perform the same task in the future. I have tried with the relative reference on and off.
The outcome:
It performs the recorded macro, but only to that cell. Every time I run the macro it doesn't do it for the next cell and row.
Can anyone help? Thanks.
- Code: Select all
Sub Combinationfilter()
Selection.Copy
ActiveSheet.Range("$A$3:$AJ$1955").AutoFilter Field:=4, Criteria1:= _
"2-0,1-0,1-0"
ActiveWindow.Panes(1).Activate
Range("B2:J2").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.Panes(3).Activate
Range("O1930").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("D1930").Select
ActiveSheet.Range("$A$3:$AJ$1955").AutoFilter Field:=4
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub