+ Reply to Thread
Results 1 to 2 of 2

Thread: Save multiple files using contents of a column

  1. #1
    Registered User
    Join Date
    01-16-2011
    Location
    South NJ
    MS-Off Ver
    Excel 2010
    Posts
    1

    Save multiple files using contents of a column

    Hello,

    I知 not certain how to word this, but here is my attempt:

    I have a template in an excel worksheet that needs to be saved using a thousand plus plan names which are listed in another excel sheet under column c.

    basically i want to run a macro that will pull the name out of column c (on the list worksheet) and repeatedly save the template file using the plan names listed in column c on the (list worksheet). So once all is complete, there will be a thousand plus files saved in a folder that will all have the template on them.

    any advice on how to write a code to do that? (I知 using the developer tab/vba in excel)

    -I知 very new to creating macros, so far i've only recorded macros, never written. (i've tweaked per book instructions and I知 still learning language etc). I think I need to add something called a loop to the macro text.

  2. #2
    Forum Contributor
    Join Date
    10-06-2008
    Location
    Canada
    Posts
    141

    Re: new to excel macros - saving multiple files using contents of a column in excel

    Try this
    Sub SADS()
    Dim MyPath As String, MyRange As Range
    MyPath = ThisWorkbook.Path
    Set MyRange = Sheets(1).Range("C1", Range("C" & Rows.Count).End(xlUp))
    For Each c in MyRange
    ThisWorkbook.SaveAs Filename:=MyPath & "\" & c.Value & ".xls"
    Next
    End Sub
    It assumes the names start in C1 and you want them saved in the same directory as your active sheet with the names.
    However, I don't know if you want to save them as .xls so you probably need to change that.

    Regards
    John

    I just read that it is in different workbooks. Only works from this workbook.
    Last edited by jolivanes; 01-16-2011 at 11:07 PM. Reason: need new code

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0