I have a report named rptJR which contains an external query. I need some code that will copy and paste special values + formats to the bottom of another sheet called Jobs. There are two blank rows in between each report pasted into the Jobs sheets. The Report also has blank cells in the header rows. The code below will find the first empty row at the bottom of all reports but it will not paste values + format in that cell. I get an error on the "Range("1Row").Select" line.
VBA Code:
Sub Macro5()
'
' Copy & Past Report to Jobs sheet
'
'
'Finds the last non-blank cell on a sheet/range.
Dim lRow As String
Dim lCol As Long
1Row = "A" & Cells.Find(What:="*", _
After:=Range("A1"), _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row + 1
'Copy and Paste report into
Application.Goto Reference:="rptJR"
Selection.Copy
Sheets("Jobs").Select
ActiveWindow.SmallScroll Down:=3
Range("1Row").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
Last edited by a moderator: