SolemnSpirit
New Member
Hi, I have the following code to filter a table, select the visible cells from one of its columns and then paste the contents to another sheet.
The code is currently in a button click event but for some reason will only work the second time the button is pressed or the first time if I enter a cell and press enter or calculate the sheet first.
Any ideas why this would be ?
Code:
Worksheets("QEImportData").ListObjects("QE_Import_Data").Range.AutoFilter Field:=41, Criteria1:="Closed"
Worksheets("QEImportData").ListObjects("QE_Import_Data").ListColumns(41).DataBodyRange.Copy Worksheets("Metrics").Range("U3")
The code is currently in a button click event but for some reason will only work the second time the button is pressed or the first time if I enter a cell and press enter or calculate the sheet first.
Any ideas why this would be ?