+ Reply to Thread
Results 1 to 4 of 4

Auto save as Cell M7 & M8

  1. #1
    Forum Contributor
    Join Date
    09-04-2013
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    117

    Auto save as Cell M7 & M8

    So i have this macro running currently


    Private Sub CommandButton1_Click()
    Dim Path As String
    Dim FileName As String
    Path = "C:\Users\OFFICE\Dropbox\XXX\XXX\2013-14\"
    FileName = Range("M7")

    ActiveWorkbook.SaveAs FileName:=Path & FileName & ".xlsm"
    Application.Dialogs(xlDialogPrint).Show
    End Sub

    M7 being the invoice number. However I wanted to auto save as "M7 - M8" but i cant seem to find the correct way to express it. Im very new to macros so apologise if this is either very simple or actually not possible.

    Thanks in advance for any advice

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Auto save as Cell M7 & M8

    You almost have it...

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-04-2013
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    117

    Re: Auto save as Cell M7 & M8

    Quote Originally Posted by yudlugar View Post
    You almost have it...

    Please Login or Register  to view this content.
    Many thanks!

    I continued playing around, as i said im fairly new to this, i tried this (below) and seems to work, is this essentially the same as your code??

    Private Sub CommandButton1_Click()
    Dim Path As String
    Dim FileName1 As String
    Dim Filename2 As String
    Path = "C:\Users\OFFICE\Dropbox\xxx\xxx\2013-14\"
    FileName1 = Range("M7")
    Filename2 = Range("M8")
    ActiveWorkbook.SaveAs FileName:=Path & FileName1 & "-" & Filename2 & ".xlsm"
    Application.Dialogs(xlDialogPrint).Show
    End Sub

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Auto save as Cell M7 & M8

    Yes it's the same thing.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. auto plug in cell as save as (multi)
    By DPPHAM in forum Excel General
    Replies: 6
    Last Post: 06-11-2014, 06:27 PM
  2. how do you set a cell to auto save when populated
    By JACKBKNIMBLE in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-18-2013, 12:43 PM
  3. how do you set a cell to auto save I am Reposting this because I am not getting any help!
    By JACKBKNIMBLE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2013, 02:36 PM
  4. Auto Save on a cell value
    By datahouse in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2012, 09:07 AM
  5. auto save with cell value in save name
    By sleepwaker83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2010, 07:26 AM

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