Consulting

Results 1 to 3 of 3

Thread: save as with auto name

  1. #1
    VBAX Contributor
    Joined
    Jul 2011
    Location
    Manchester
    Posts
    142
    Location

    save as with auto name

    The code below works to autoname a file based on certain cells within a worksheet but rather than save in the background is it possible to bring up the save as dialogue box with the file name already populated?
    [VBA]Sub Save()

    Sheets("Letter Creation").Select
    Range("c3").Select
    a = ActiveCell.Value
    Range("c5").Select
    b = ActiveCell.Value
    Range("b16").Select
    c = ActiveCell.Value

    q3 = a & " " & b & " " & "(" & c & " " & d

    ActiveWorkbook.SaveAs Filename:=q3 & Format(Date, "mmmm dd yyyy") & ")" & ".xls"

    End Sub[/VBA]


    Thanks
    Last edited by mykal66; 07-19-2011 at 12:06 PM.

  2. #2
    VBAX Expert CatDaddy's Avatar
    Joined
    Jun 2011
    Posts
    581
    Location
    [vba]
    Sub Save()


    Sheets("Letter Creation").Select
    Range("c3").Activate
    a = ActiveCell.Value
    Range("c5").Activate
    b = ActiveCell.Value
    Range("b16").Activate
    c = ActiveCell.Value

    q3 = a & " " & b & " " & "(" & c & " " & d

    Dim chk as Integer
    chk = InputBox(q3 & Format(Date, "mmmm dd yyyy") & ")" & ".xls" & vbCrLf & "1) Save" & vbCrLf & "2) Abort")
    if chk = 1
    ActiveWorkbook.SaveAs Filename:=q3 & Format(Date, "mmmm dd yyyy") & ")" & ".xls"
    End If

    End Sub
    [/vba]
    ------------------------------------------------
    Happy Coding my friends

  3. #3
    VBAX Expert
    Joined
    Sep 2010
    Posts
    604
    Location
    [VBA]
    '.........

    Application.Dialogs(xlDialogSaveAs).Show _
    ("C:\YourFolder\" & q3 & " (" & Format(Date, "mmmm dd yyyy") & ")" & ".xls")[/VBA]

Posting Permissions

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