VBA - open a filename, print, close, open the next

jsolomon

Board Regular
Joined
Mar 25, 2005
Messages
109
Hi, I have about 150 filenames (all of which are in the same directory) in an excel column (a1:a150 we'll say). I would like vba to read the filename from the cell starting with a1, open that filename, print it, close it then open the next one in the list (a2). I will probably have to use VBA. What is the best way to do this?

thanks

joe
 
The first For Each is going through every cell (c) in a range (Rng).

The second one is going through every worksheet (ws) in the workbook (wb).
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
i see, so it really has no other purpose than to close the "for" command? What site would you recommend as a tutorial for the basic VBA syntax? I am really anxious to learn it as I can see really see it's power.

thanks again for your patience and help

joe
 
Upvote 0

Forum statistics

Threads
1,216,171
Messages
6,129,286
Members
449,498
Latest member
Lee_ray

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