Hi,
I am using the below code to make a seperate excel file for each worksheet in the same folder.
Now i would want the code to make a pdf for each worksheet instead of excel file.
Any help would be appreciated..
Regards,
Humayun
I am using the below code to make a seperate excel file for each worksheet in the same folder.
Code:
[COLOR=#333333]Sub Splitbook()[/COLOR]
[COLOR=#333333]Dim xPath As String[/COLOR]
[COLOR=#333333]xPath = Application.ActiveWorkbook.Path[/COLOR]
[COLOR=#333333]Application.ScreenUpdating = False[/COLOR]
[COLOR=#333333]Application.DisplayAlerts = False[/COLOR]
[COLOR=#333333]For Each xWs In ThisWorkbook.Sheets[/COLOR]
[COLOR=#333333]xWs.Copy[/COLOR]
[COLOR=#333333]Application.ActiveWorkbook.SaveAs Filename:=xPath & "" & xWs.Name & ".xlsx"[/COLOR]
[COLOR=#333333]Application.ActiveWorkbook.Close False[/COLOR]
[COLOR=#333333]Next[/COLOR]
[COLOR=#333333]Application.DisplayAlerts = True[/COLOR]
[COLOR=#333333]Application.ScreenUpdating = True[/COLOR]
[COLOR=#333333]End Sub[/COLOR]
Now i would want the code to make a pdf for each worksheet instead of excel file.
Any help would be appreciated..
Regards,
Humayun