View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
KDP KDP is offline
external usenet poster
 
Posts: 16
Default Save as from a list

Barb - I've never done this before, but this is what I've got. When I run the
macro, it gives me the message:

Compile Error:

Expected Sub, Function, or Property

and the fname at the end is highlighted...


------------------------------------------------------

Sub Open1()
'
' Open1 Macro
' Macro recorded 3/29/2007 by b39769
'

'
Workbooks.Open Filename:="H:\oWb.xls"

For i = 2 To aws.Cells(Rows.Count, 1).End(xlUp).Row
fname = aws.Cells(i, 1).Value
Next i

oWB.SaveCopyAs Filename: fname

End Sub

-----------------------------------------------------


i have hardly any idea what i'm doing...i've gotta get a book or something
on this.

THANKS!


"Barb Reinhardt" wrote:

I can envision how I'd do this, but it would take some time to create the
code. This is what I'd do:

1) Create a workbook with the list of users ids that you want to use. I'd
probably call this aWB. Refer to the sheet with the user ids as aWS.
2) Create a macro to open the file that you want to perform the multiple
save as on. Use something like this
http://www.mrexcel.com/td0009.html
I'd probably refer to this workbook as oWB
3) Extract the user names from that worksheet. I'd put the first name in
row 2 column 1. I'd use something like

for i = 2 to aws.cells(rows.count,1).end(xlup)
fname = aws.cells(i,1).value
next i

4) WIthin the for/next loop, do the following

oWB.SaveAs Filename: fname

5) You could probably automate the emailing, but I've not done that in a
bit so am not sure where to start.

"KDP" wrote:

I have one workbook that I create every month and distribute to employees.
Every employee has their own version of this workbook.

Normally, I create the blank workbook and do a File-SaveAs (their operator
#/name).

Instead of doing this 30 times and saving as each persons name/number, is it
possible to key a list of their names and run a macro (or something else) to
automatically create a file with each persons name???