Need a Macro to convert excel tabs into PDF

Umareddy

New Member
Joined
Jun 22, 2019
Messages
5
Hello Mr.Excel

I have multiple set of workbooks where the file name is standard except first two letters.
In each workbook I have multiple tabs where the tab names are standard across the multiple workbooks.

I am looking for an macro to convert the excel tabs into separate PDF files.
Particularly I am looking for the option of selection, where I should select the workbook names from the list as well as tab names from the list. Only selected tabs should be converted into PDF(separately) and save in the folder against the tab name. These PDF sheets should be saved in the separate folders when I select the multiple workbook.

As I mentioned workbook names are different and tab names are standard across the multiple workbooks.

I searched multiple posts from google and don't see any which would suffice my requirements.

It would be great help if you could help me in this.

Thanks,
Uma
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
You are correct...I thought you might use that info to wrap around a loop through your sheets per workbook.
 
Upvote 0
I think this will work:

Code:
Sub AllSheetsToPDF()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
 ws.Activate
 If WorksheetFunction.CountA(Cells) = 0 Then
 MsgBox "Sheet: " & (ActiveSheet.Name) & " is empty"
 Else
 SaveasPDF
 End If
Next ws
End Sub
 
Upvote 0
Hey Thanks again. From above coding I understood that it will PDF all the sheets except the empty sheet.

In my excel workbook I have more than 50 sheets which have the data. Around 40 sheets have raw data and 10+ sheets have the summary dashboards which is derived by using the raw data. I may wanted to PDF only summary slide sheets not the raw data sheets.

Can you please help!
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top