Consulting

Results 1 to 3 of 3

Thread: Solved: need to add a macro on save

  1. #1
    VBAX Regular
    Joined
    Jul 2008
    Posts
    43
    Location

    Solved: need to add a macro on save

    I need a code that will, when you hit save, take the value from A12 and H10 and use it as the file name to save it to the folder "time sheets".
    Can anyone give me a hand?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
    Boolean)
    Dim sFile
    Application.EnableEvents = False
    '<Optional - this would be before save code>
    If SaveAsUI Then
    'continue
    Else
    Cancel = True
    ThisWorkbook.SaveAS Activesheet.Range("A12").Value & Activesheet.Range("H10").Value
    End If
    Application.EnableEvents = True
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Jul 2008
    Posts
    43
    Location

    still not working

    That code did even less. Any other solutions?

Posting Permissions

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