+ Reply to Thread
Results 1 to 11 of 11

Macro for saving files every time worksheet is updated

  1. #1
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Macro for saving files every time worksheet is updated

    Hi i have a macro currently that when i hit the button it saves the worksheet to a folder as the name of a certain cell. what i would like to do is alter the macro to save and replace the old file every time the workbook is updated with new info.

  2. #2
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Macro for saving files every time worksheet is updated

    This is my current save code


    Dim sFile As String
    sFile = Sheets("picking log with colons").Range("D1").Value & ".xlsm"

    ActiveWorkbook.SaveAs Filename:="D:\picking logs\" & sFile, FileFormat:=52

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macro for saving files every time worksheet is updated

    Hello superchew,

    Use this code in ThisWorkook:

    Please Login or Register  to view this content.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Macro for saving files every time worksheet is updated

    Winon,
    I am a newbie where to I put where i want it to save to and the cell i want it saved as.

  5. #5
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Macro for saving files every time worksheet is updated

    and will this save it everytime the sheet is updated and overwrite the last save without asking everytime if i want to.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macro for saving files every time worksheet is updated

    Hello superchew,

    Please could you upload a sample Workbook, with your existing Code, for us to have a look at for you.

  7. #7
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Macro for saving files every time worksheet is updated

    here you go. currently the save function is in module 5 I believe.

    Test 6.xlsm

    Test 7.xlsm

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macro for saving files every time worksheet is updated

    Hello superchew,

    There you go, try the attached Workbooks now.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Macro for saving files every time worksheet is updated

    okay... how do i make it save to spefic file path and save as specific cell data? in not how do i add that.

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Macro for saving files every time worksheet is updated

    Hello superchew,

    In your first post you state the following;

    Hi i have a macro currently that when i hit the button it saves the worksheet to a folder as the name of a certain cell. what i would like to do is alter the macro to save and replace the old file every time the workbook is updated with new info.
    Which is exactly what the WorkBooks I have uploaded are doing. It replaces the old files with new Data. Now you say,
    okay... how do i make it save to spefic file path and save as specific cell data?
    If you want to replace the "Old File" and save it as specific cell data, it either has to be the correct File which you have opened, otherwise, if it is not, a new file will be created in whatever Path you have entered in your Code.

    If that is what you want, then just stick with your Code that you have, as mentioned in your first Post.

  11. #11
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Macro for saving files every time worksheet is updated

    Sorry for the confusion. I guess what I am looking for is to keep my save funtion as is so when i hit start new batch it saves file to the specific batch and as a specific cell data, also i want it to save as I go.

+ 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. [SOLVED] Saving worksheet using a macro. Problem is that it is saving more rows than it needs to
    By Kammphoto in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2013, 10:09 AM
  2. Add/Updated One Worksheet from another - Macro/VBA ?
    By williamthomp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2012, 12:05 PM
  3. macro with vba forms updated by multiple users in real-time
    By juggernautfreak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2010, 05:51 AM
  4. Replies: 3
    Last Post: 06-27-2007, 03:16 AM
  5. Saving Excel files takes a huge amount of time
    By Heavy Excel user in forum Excel General
    Replies: 6
    Last Post: 01-12-2006, 08:15 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