VBA LOOP Help

dbright

New Member
Joined
Dec 19, 2018
Messages
2
Hi all,

I have a repetitive process that I am trying to automate which consists of the following steps:
1) Take 5 pieces of data from a record on worksheet A with 200 records and input those pieces of data into worksheet B
2) Take Worksheet B and save the tab as a PDF in a new location
3) Name the PDF after a cell in the record
4) Repeat until all 200+ records are done resulting in 200+ PDFs in a Folder

I have the VBA done for one record, but how do I loop all of these steps over and over until all records are completed?

Any help would be greatly appreciated as any attempt at looping has been unsuccessful thus far.

Thanks,

DB
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
you need to dim and set a couple range variables.

Code:
dim rng as range, cell as range

set rng=activesheet.range("A1:A10")     'your range of data in worksheet A (only need one column)
for each cell in rng
your code for creating and naming the PDF file
next cell
 
Upvote 0
Ok thank you. I will create my code and may have an additional question if I mess it up.


you need to dim and set a couple range variables.

Code:
dim rng as range, cell as range

set rng=activesheet.range("A1:A10")     'your range of data in worksheet A (only need one column)
for each cell in rng
your code for creating and naming the PDF file
next cell
 
Upvote 0
Can you post the code you have for one record?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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