G
GeorgeA
Hello,
The macro below copies and pastes a row of data from sheet 'Zoomerang Data'
into row 2 and calculations reference that row. The results are formatted
into a report and the macro saves the report in PDF and then copies the next
data row and overwrites Row 2, etc... It works great (Thanks Joel!) but I
have to open each PDF to verify the results.
I have made a new sheet called Results that references the required fields
in the 'Benefits Report' sheet (ie. ='Benefits Report'!D18, etc..). I'd like
to end up with rows of data that show the results of each report, but I get
stuck because the macro below always overwrites the last row the row for
calculations and I don't know how to keep the results from overwriting. I was
trying Paste Values but then I lose the references in the Results fields. Can
someone help me out. Thanks!
Sub BenefitsReport()
'
' BenefitsReport Macro
'
Folder = "C:\Users\Andrew\Documents\M-Link\Benefit Reports\"
FName = " TDMP Benefits Report.pdf"
'
Set ZoomSht = Sheets("Zoomerang Data")
With ZoomSht
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
For RowCount = 11 To 1500
.Rows(RowCount).Copy _
Destination:=.Rows(2)
Sheets("Benefits Report").ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=Folder & _
.Range("H" & RowCount) & _
FName, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next RowCount
End With
End Sub
The macro below copies and pastes a row of data from sheet 'Zoomerang Data'
into row 2 and calculations reference that row. The results are formatted
into a report and the macro saves the report in PDF and then copies the next
data row and overwrites Row 2, etc... It works great (Thanks Joel!) but I
have to open each PDF to verify the results.
I have made a new sheet called Results that references the required fields
in the 'Benefits Report' sheet (ie. ='Benefits Report'!D18, etc..). I'd like
to end up with rows of data that show the results of each report, but I get
stuck because the macro below always overwrites the last row the row for
calculations and I don't know how to keep the results from overwriting. I was
trying Paste Values but then I lose the references in the Results fields. Can
someone help me out. Thanks!
Sub BenefitsReport()
'
' BenefitsReport Macro
'
Folder = "C:\Users\Andrew\Documents\M-Link\Benefit Reports\"
FName = " TDMP Benefits Report.pdf"
'
Set ZoomSht = Sheets("Zoomerang Data")
With ZoomSht
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
For RowCount = 11 To 1500
.Rows(RowCount).Copy _
Destination:=.Rows(2)
Sheets("Benefits Report").ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=Folder & _
.Range("H" & RowCount) & _
FName, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next RowCount
End With
End Sub