+ Reply to Thread
Results 1 to 4 of 4

!! Can you do this !!

  1. #1
    Karthik Bhat - Bangalore
    Guest

    !! Can you do this !!

    Hi


    I have a file which is to be sent out to different recipients (at least

    200). Although the file is same I need to send this to various
    recipients with different file names. I have a list that is to be used
    to name the files.
    For example I have a file called Report.xls and have a list a, b,
    c...z. (in a file Nemes.xls). I want a code that will save the file
    report.xls as a.xls, b.xls.... z.xls in the specified folder/location.


    I know this is possible using VBA code.
    Can you helpme by giving some useful code?


    Karthik Bhat
    (Bangalore)


  2. #2
    Tom Ogilvy
    Guest

    Re: !! Can you do this !!

    if Report.xls is not open in excel you can use the filecopy command.

    filecopy "C:\myfolder\report.xls", "C:\Mystructure\" &
    workbooks("Nemes.xls") _
    .Worksheets("Sheet1").Cells(i,"B").Value & ".xls"

    if it is open, then use FileSaveCopyAs

    Workbooks("Report.xls").SaveCopyAs "C:\MyStructure\" & _
    workbooks("Nemes.xls").Worksheets("Sheet1").Cells(i,"B").Value & ".xls"


    --
    Regards,
    Tom Ogilvy

    "Karthik Bhat - Bangalore" <karthik.bhat@db.com> wrote in message
    news:1123681854.026136.99360@g49g2000cwa.googlegroups.com...
    > Hi
    >
    >
    > I have a file which is to be sent out to different recipients (at least
    >
    > 200). Although the file is same I need to send this to various
    > recipients with different file names. I have a list that is to be used
    > to name the files.
    > For example I have a file called Report.xls and have a list a, b,
    > c...z. (in a file Nemes.xls). I want a code that will save the file
    > report.xls as a.xls, b.xls.... z.xls in the specified folder/location.
    >
    >
    > I know this is possible using VBA code.
    > Can you helpme by giving some useful code?
    >
    >
    > Karthik Bhat
    > (Bangalore)
    >




  3. #3
    Karthik Bhat - Bangalore
    Guest

    Re: !! Can you do this !!

    Hi Tom

    Thans for your reply.. But how will the value of "i" in the code be
    derived from.. Shouldn't there be a if loop untill the last nonbalank
    row in the names.xls file..


  4. #4
    Tom Ogilvy
    Guest

    Re: !! Can you do this !!

    That is what I am implying by the i - but you gave no information on where
    the list is located or the size of the list.

    --
    Regards,
    Tom Ogilvy


    "Karthik Bhat - Bangalore" <karthik.bhat@db.com> wrote in message
    news:1123685514.878953.147780@z14g2000cwz.googlegroups.com...
    > Hi Tom
    >
    > Thans for your reply.. But how will the value of "i" in the code be
    > derived from.. Shouldn't there be a if loop untill the last nonbalank
    > row in the names.xls file..
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.6.0 RC 1