+ Reply to Thread
Results 1 to 4 of 4

Auto Save on closing

  1. #1
    AJM1949
    Guest

    Auto Save on closing

    I would like to auto save an excel workbook using a cell value as the file
    name and save it in a specific folder ie My Documents\Quotes. I have been
    unable to find an answer to this in previous responses. Any help would be
    very much appreciated.

    Thanks in advance
    --
    AJM1949

  2. #2
    Bob Phillips
    Guest

    Re: Auto Save on closing

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ThisWorkbook.SaveAs Filename:=Worksheets("Sheet1").Range("A1").Value
    End Sub

    'This is workbook event code.
    'To input this code, right click on the Excel icon on the worksheet
    '(or next to the File menu if you maximise your workbooks),
    'select View Code from the menu, and paste the code


    --
    HTH

    Bob Phillips

    "AJM1949" <AJM1949@discussions.microsoft.com> wrote in message
    news:F47AF254-70AC-4C72-A747-59A06E027F01@microsoft.com...
    > I would like to auto save an excel workbook using a cell value as the file
    > name and save it in a specific folder ie My Documents\Quotes. I have been
    > unable to find an answer to this in previous responses. Any help would be
    > very much appreciated.
    >
    > Thanks in advance
    > --
    > AJM1949




  3. #3
    AJM1949
    Guest

    Re: Auto Save on closing

    Hello Bob
    Many thanks for the code. How can I specify the path to save the workbook
    to-in this instance I want it to be My Documents\Quotes.
    --
    AJM1949


    "Bob Phillips" wrote:

    > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    > ThisWorkbook.SaveAs Filename:=Worksheets("Sheet1").Range("A1").Value
    > End Sub
    >
    > 'This is workbook event code.
    > 'To input this code, right click on the Excel icon on the worksheet
    > '(or next to the File menu if you maximise your workbooks),
    > 'select View Code from the menu, and paste the code
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > "AJM1949" <AJM1949@discussions.microsoft.com> wrote in message
    > news:F47AF254-70AC-4C72-A747-59A06E027F01@microsoft.com...
    > > I would like to auto save an excel workbook using a cell value as the file
    > > name and save it in a specific folder ie My Documents\Quotes. I have been
    > > unable to find an answer to this in previous responses. Any help would be
    > > very much appreciated.
    > >
    > > Thanks in advance
    > > --
    > > AJM1949

    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: Auto Save on closing

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ThisWorkbook.SaveAs Filename:= "C:\My Doc umtnets\Quotes\" & _
    Worksheets("Sheet1").Range("A1").Value
    End Sub

    --
    HTH

    Bob Phillips

    "AJM1949" <AJM1949@discussions.microsoft.com> wrote in message
    news:751201DC-96F1-4481-82A8-5824227A541F@microsoft.com...
    > Hello Bob
    > Many thanks for the code. How can I specify the path to save the workbook
    > to-in this instance I want it to be My Documents\Quotes.
    > --
    > AJM1949
    >
    >
    > "Bob Phillips" wrote:
    >
    > > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    > > ThisWorkbook.SaveAs Filename:=Worksheets("Sheet1").Range("A1").Value
    > > End Sub
    > >
    > > 'This is workbook event code.
    > > 'To input this code, right click on the Excel icon on the worksheet
    > > '(or next to the File menu if you maximise your workbooks),
    > > 'select View Code from the menu, and paste the code
    > >
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > "AJM1949" <AJM1949@discussions.microsoft.com> wrote in message
    > > news:F47AF254-70AC-4C72-A747-59A06E027F01@microsoft.com...
    > > > I would like to auto save an excel workbook using a cell value as the

    file
    > > > name and save it in a specific folder ie My Documents\Quotes. I have

    been
    > > > unable to find an answer to this in previous responses. Any help would

    be
    > > > very much appreciated.
    > > >
    > > > Thanks in advance
    > > > --
    > > > AJM1949

    > >
    > >
    > >




+ 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