Code to extract tables to PDF

AliciaGoyanes

New Member
Joined
Sep 29, 2022
Messages
19
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
Hi everyone,

I am new to this forum. I am trying to do the following: extract certain tables from excel into a pdf.

Is there any code to do so and extract certain rows and columns (e.g. A2:C10) from (e.g. Sheet 1) and through a button extract those cells selected to a pdf?

I'd like to be able to adapt the rows and columns and sheet names in the code, so for the exercise:

A2:C10 from Sheet 1 called 'Sheet 1'

C40:D40 from Sheet 2 called 'Sheet 2'

As I will add some comments above each table in the same pdf, I would like to have a space of around 5-7 lines between each table. I am not sure if that's possible.

Tks a lot in advance.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Welcome to MrExcel forums.

To save multiple ranges on different sheets to a single PDF you have to copy the ranges to a temporary sheet, putting them in suitable cells to give the required spacing, add the comments in cells and save it as a PDF.

See if this code helps to get you started:

 
Upvote 0

Forum statistics

Threads
1,215,042
Messages
6,122,810
Members
449,095
Latest member
m_smith_solihull

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