bst365体育投注网址大全I am trying to build a macro and I want to copy a row after selecting a specific cell with the filter. So I filter a cell in column "A" and then I want to copy all the cells in that row. The problem is that the rownumber corresponding to the selected cell may change, due to different datasets.
Below is the code:
Selection.AutoFilter ActiveSheet.Range("$A$1:$DO$46").AutoFilter Field:=2, Criteria1:= _ "NAME" Range("A5:DO5").Select Selection.Copy
The point is that in VBA the selection is set at "A5:DO5", because in this specific dataset "NAME" is on "A5".
But in a different dataset "NAME" might be on "A9", but in VBA the selection of the row is still on "A5:DO5".
How can I make the selection of "NAME" and the copy of all the cells in the row of "NAME" linked to eachother?