Hi All,
All I am trying to do is essentially copy'n'paste data between sheets using VBA - something I have written code to do many times before...
only this time I am getting an error on the line:
[/pre]
Assistance gratefully received
Jabba
All I am trying to do is essentially copy'n'paste data between sheets using VBA - something I have written code to do many times before...
only this time I am getting an error on the line:
Code:
Range("K2").Select
with the error "Select method of Range class failed"
The sub is in "ASheet" not a module... and invokes when I update/refresh a pivot table in that sheet... the range is NOT part of the pivot table although values in the range to copy do change based on GetPivot functions against that pivot table.
The idea is that the pivot table changes - which updates a range - (all on ASheet) which I then filter on and I copy the filtered range (on ASheet) to a totally different sheet... (AnotherSheet) - all pretty straight forward until this error cropped up and now I am stumped :)
[pre]Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
ActiveSheet.Range("$G$3:$K$100").AutoFilter Field:=3, Criteria1:="TRUE"
Range("G4:K100").Select
Selection.Copy
Sheets("AnotherSheet").Select
Range("K2").Select
ActiveSheet.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
Assistance gratefully received
Jabba