Need macro to sequentially populate worksheet from other worksheet + save as .pdf (Excel 2007)

NBMG1

New Member
Joined
Jun 25, 2013
Messages
1
Hello Forum:
I am just getting started with macros, could not make this work, and would greatly appreciate your help and expertise.

The task we are trying to execute is essentially populating a chart (Sheet 1) repeatedly with data from sequential rows in a table (Sheet 2), and saving each new result as a .pdf with a certain cell value as the filename, so that each row of Sheet 2 is represented by a unique .pdf form. The worksheets are in the same workbook.

Here is the process as we've doing it manually:

- FIND [row number from Sheet 2] in Sheet 1 ((Sheet 1 cells already contain formulas to fill cells with values from Sheet 2; see below))
- REPLACE with [next sequential row number from Sheet 2]
- SAVE Sheet 1 as .pdf with Cell A3 value as file name
- Repeat (to last row of Sheet 2)

Here is a simplified version of what the worksheets look like:

Sheet 1
A
B
C
1
2
[ heading text ]
[ heading text ]
[ heading text ]
3
[=Sheet2!C2]</SPAN>

<TBODY>
</TBODY>
[=Sheet2!A2]</SPAN>
[=Sheet2!D2]</SPAN>
4
5
[ heading text ]</SPAN>
[ heading text ]</SPAN>
6
[=Sheet2!H2]</SPAN>
[=Sheet2!F2]</SPAN>
7
8
[ heading text ]
9
[=Sheet2!B2]</SPAN>
10
11
[ heading text ]
[ heading text ]</SPAN>
12
[=Sheet2!G2]</SPAN>
[=Sheet2!E2]</SPAN>

<TBODY>
</TBODY>
Sheet 2
A
B
C
D
E
F
G
H
I
1
[ heading ]
[ heading ]
[ heading ]
[ heading ]
[ heading ]
[ heading ]
[ heading ]
[ heading ]
[ heading ]
2
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
3
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
4
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx
xxxx

<TBODY>
</TBODY>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,216,030
Messages
6,128,408
Members
449,448
Latest member
Andrew Slatter

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