Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Saveas macro

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    HI could someone help me please,
    I want to make a SAVE AS macro so it brings up the save box, I f i record one it just saves it to where I recorded it, please could someone help please thank you.

    P.S. would it also be possible to just save the worksheet instead if the whole workbook?
    If someone has any ideas please help me, much appreciated.

    [ This Message was edited by: Brucelee on 2002-04-10 09:32 ]

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Here's a sample:

    fileSaveName = Application.GetSaveAsFilename(PathToSave, _
    fileFilter:="Excel Workbook (*.xls), *.xls")
    If fileSaveName <> False Then
    Workbooks(NewWB).Activate
    ActiveWorkbook.SaveAs fileSaveName
    MsgBox "Report saved as " & fileSaveName
    Else
    Workbooks(NewWB).Activate
    ActiveWorkbook.SaveAs PathToSave
    MsgBox "Report saved as " & PathToSave
    End If

    Look up "GetSaveAsFilename" in VBA help.

    Tom

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks for that, Is it possible to have it automatically save every 7 days as a new workbook
    e.g. workbook1/1/2002
    workbook7/1/2002

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sure
    I don't know how often you open your and intend to save your workbook under a different name.

    In the above example, PathToSave is the full path needed to save the workbook...
    You could use the current date to generate a filename for you.

    For Ex.
    You want to save you workbook in C:Weekly
    using the current date as part of the filename.

    Pathname = "C:Weeklywb & format(now,"mmddyy") & ".xls"

    would show the string and save the file as:

    C:Weeklywb041002.xls"

    Hope this helps..

    Tom

  5. #5
    New Member
    Join Date
    Apr 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    What I am doing is a weekly transaction sheet that i want to save a backup copy of products sold in that week so i want it to automatically save every monday as the file name of that date.
    Thanks for the last bit it was useful but not quite what i was thinking of.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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