I have created the code below which works up to a point then I get a run-time error 1004. Could anyone help? The error dialog box says that "PasteSpecial method of Range Class failed" and the first .PasteSpecial line is highlighted.
Sub CopyPO()
'
' CopyPO Macro
'
'
Dim rngPrintArea As Range
Set rngPrintArea = ActiveSheet.Range(ActiveSheet.PageSetup.PrintArea)
With Sheets("Inventory").Range("A" & Rows.Count).End(xlUp).Offset(1)
.PasteSpecial Paste:=xlPasteColumnWidths
.PasteSpecial Paste:=xlPasteValues
.PasteSpecial Paste:=xlPasteFormats
End With
End Sub
To clarify, I am trying to copy the print area of the active sheet and paste it in the next available cell on the inventory sheet. This code works if the range is a specific range of cells (i.e. A1:P55) but I want to copy and paste the print area if possible.