Pdf only certain ws as individual pdf files?

Viperuk

New Member
Joined
Mar 14, 2016
Messages
19
Hi all.

I am struggling to select 10 ws in a wb of around 25 ws and print them to individual pdf files. I would also like each to be renamed the ws name.

I can pdf each ws in the wb to pdf and re name but this isn't what I need.

I have tried to hide those worksheets which are not needed to be pdf'd but I seem to get an error? I think this is because the buttons which run the code are on a sheet which then becomes hidden. I cannot put the buttons on a sheet I want to pdf.

There must be an easy way to do this but I am struggling.

Any help would be appreciated.

Thanks
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Maybe check each ws name and "ignore" those that you specify ("Sheet1", "Sheet2", etc.):
Code:
Dim ws As Worksheet
For Each ws In Worksheets
    If Not ws.Name = "Sheet1" And Not ws.Name = "Sheet2" Then
        'ws to pdf code here
    End If
Next ws
 
Upvote 0

Forum statistics

Threads
1,214,574
Messages
6,120,329
Members
448,956
Latest member
Adamsxl

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