Create Multiple Files using Template with Files Names in a Column List

dmdek

New Member
Joined
May 3, 2011
Messages
4
Could someone please assist with a problem I cannot think through. I want to use 1 template file and then "save as" renaming the file 200+.

The file names will pick up their names from a column list. I was hoping the macro will have a variable so that I can indicate where the files should be stored.

I cannot figure out how to loop through the cells in the column to pick up the file names.


Thank you in advance.

Dan



Excel 2003
 

Akhi

New Member
Joined
Jun 9, 2021
Messages
4
Office Version
  1. 2013
Platform
  1. Windows
That's what .Offset(0, 1) does - offset 0 rows, 1 column. So if rng is A2, then rng.Offset(0,1) is B2.
It shows following error

1623428737935.png


1623428831837.png




What to be done?
 

Attachments

  • 1623428766397.png
    1623428766397.png
    21.3 KB · Views: 3
  • 1623428807113.png
    1623428807113.png
    20.4 KB · Views: 3

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

iliace

Well-known Member
Joined
Jan 15, 2008
Messages
3,546
Office Version
  1. 365
  2. 2016
  3. 2010
Platform
  1. Windows
Oh, my bad. It needs a sheet. Will the worksheet with H16 always be the same?

For example,
Code:
wkbTemplate.Worksheets("Sheet1").Range("H16") = rng.Offset(0, 1).Value
or if it's always the first sheet
Code:
wkbTemplate.Worksheets(1).Range("H16") = rng.Offset(0, 1).Value

something along those lines.
 

Watch MrExcel Video

Forum statistics

Threads
1,133,525
Messages
5,659,321
Members
418,496
Latest member
WHYCHumphrey

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
Top