+ Reply to Thread
Results 1 to 4 of 4

VBA Script for copy and paste to save

  1. #1
    tamato43
    Guest

    VBA Script for copy and paste to save

    I think I may be asking for too much.

    I tried Recording a Macro for Saving the content on Cell A1(which is where I
    previously enterd a name), then go to "file", then "Save as" and then try to
    Paste In the "File Name" Window.

    It doesn't seem to work.

    Does anyone know how to swing this one?

  2. #2
    Dave Peterson
    Guest

    Re: VBA Script for copy and paste to save

    You could embed that value directly in the code--you don't need to copy|paste
    into the dialog:

    Something like:

    ActiveWorkbook.SaveAs Filename:=ActiveSheet.Range("a1").Value & ".xls", _
    FileFormat:=xlWorkbookNormal



    tamato43 wrote:
    >
    > I think I may be asking for too much.
    >
    > I tried Recording a Macro for Saving the content on Cell A1(which is where I
    > previously enterd a name), then go to "file", then "Save as" and then try to
    > Paste In the "File Name" Window.
    >
    > It doesn't seem to work.
    >
    > Does anyone know how to swing this one?


    --

    Dave Peterson

  3. #3
    tamato43
    Guest

    Re: VBA Script for copy and paste to save

    Thank you very much,

    Is it also possible to designate a folder?

    "Dave Peterson" wrote:

    > You could embed that value directly in the code--you don't need to copy|paste
    > into the dialog:
    >
    > Something like:
    >
    > ActiveWorkbook.SaveAs Filename:=ActiveSheet.Range("a1").Value & ".xls", _
    > FileFormat:=xlWorkbookNormal
    >
    >
    >
    > tamato43 wrote:
    > >
    > > I think I may be asking for too much.
    > >
    > > I tried Recording a Macro for Saving the content on Cell A1(which is where I
    > > previously enterd a name), then go to "file", then "Save as" and then try to
    > > Paste In the "File Name" Window.
    > >
    > > It doesn't seem to work.
    > >
    > > Does anyone know how to swing this one?

    >
    > --
    >
    > Dave Peterson
    >


  4. #4
    Dave Peterson
    Guest

    Re: VBA Script for copy and paste to save

    Sure:

    dim myFolder as string
    myfolder = "C:\my documents\excel\"

    ActiveWorkbook.SaveAs Filename:=myfolder & _
    ActiveSheet.Range("a1").Value & ".xls", FileFormat:=xlWorkbookNormal



    tamato43 wrote:
    >
    > Thank you very much,
    >
    > Is it also possible to designate a folder?
    >
    > "Dave Peterson" wrote:
    >
    > > You could embed that value directly in the code--you don't need to copy|paste
    > > into the dialog:
    > >
    > > Something like:
    > >
    > > ActiveWorkbook.SaveAs Filename:=ActiveSheet.Range("a1").Value & ".xls", _
    > > FileFormat:=xlWorkbookNormal
    > >
    > >
    > >
    > > tamato43 wrote:
    > > >
    > > > I think I may be asking for too much.
    > > >
    > > > I tried Recording a Macro for Saving the content on Cell A1(which is where I
    > > > previously enterd a name), then go to "file", then "Save as" and then try to
    > > > Paste In the "File Name" Window.
    > > >
    > > > It doesn't seem to work.
    > > >
    > > > Does anyone know how to swing this one?

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

+ 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