laskisperj
New Member
- Joined
- Jun 18, 2008
- Messages
- 3
I'm currently using the following macro to save an active worksheet as a pdf:
Sub SaveAsPDF()
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Documents and Settings\My Documents\" & Range("a1").Value & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
I want this to loop through each of the worksheets in the worksbook to create a different pdf file for each worksheet, but keep getting errors...i think with "Activesheet"
I tried using:
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Sub SaveAsPDF()
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Documents and Settings\My Documents\" & Range("a1").Value & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End Sub
I want this to loop through each of the worksheets in the worksbook to create a different pdf file for each worksheet, but keep getting errors...i think with "Activesheet"
I tried using:
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets