Hi there, I have looked at previous posts and found some information about ActiveSheet.Paste errors, which appear to be related to having activate, select and paste functions in the wrong order.
I am still getting an error at the ActiveSheet.Paste point of my code which I cannot seem to overcome, although this same code works on another macro doing exactly the same action...
Any ideas why this fails yet works on another similar macro in the right way?
Cheers
I am still getting an error at the ActiveSheet.Paste point of my code which I cannot seem to overcome, although this same code works on another macro doing exactly the same action...
Code:
ChDir _
"[URL="file://workgroup/Highlight_reporting/Templates"]\\workgroup\Highlight_reporting\Templates[/URL]"
Workbooks.Open Filename:= _
"[URL="file://workgroup/Highlight_reporting/Templates/Programme"]\\workgroup\Highlight_reporting\Templates\Programme[/URL] report template.xls"
Windows("Milestones_matrix.xls").Activate
Application.Run "'Milestones_matrix.xls'!ResetFilters"
Range("A11").Select
Sheets("All Milestones").Select
Selection.AutoFilter Field:=18, Criteria1:="=1", Operator:=xlAnd
LR = Cells(65536, 3).End(xlUp).Row
If LR > 2 Then
Range("B3:M" & LR).SpecialCells(xlCellTypeVisible).Copy
Windows("Programme report template.xls").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
End If
Range("A49").Select
Windows("Milestones_matrix.xls").Activate
Application.Run "'Milestones_matrix.xls'!ResetFilters"
Selection.AutoFilter Field:=19, Criteria1:="=1", Operator:=xlAnd
LR = Cells(65536, 3).End(xlUp).Row
If LR > 2 Then
Range("B3:M" & LR).SpecialCells(xlCellTypeVisible).Copy
Windows("Programme report template.xls").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
End If
End Sub
Any ideas why this fails yet works on another similar macro in the right way?
Cheers