+ Reply to Thread
Results 1 to 13 of 13

VBA code that will save anytime sheet is updated and..

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

    Unhappy VBA code that will save anytime sheet is updated and..

    I need a vba for the below sample that will save the sheet every time it is update. also every time i save it says that workbook already exist and ask if i want to replace. I need a vba code that automatically says yes to thes questions.

    Test 7.xlsm

  2. #2
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: VBA code that will save anytime sheet is updated and..

    Hi,

    See if this code helps. Place it under the module for Sheet 1

    Please Login or Register  to view this content.
    Thanks

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

    Re: VBA code that will save anytime sheet is updated and..

    is there a way to set this up to save to a specifice file folder.

  4. #4
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: VBA code that will save anytime sheet is updated and..

    why would you want that? you place the file or a copy in the folder you want and thats it. its not like you are saving copies of it.

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

    Re: VBA code that will save anytime sheet is updated and..

    I need to save it as the batch numner in cell D1 whilch will change everytime we start a new batch.

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

    Re: VBA code that will save anytime sheet is updated and..

    what if after i start new batch when ever i enter the batch number in D1 is saves it as that batch number to a certain file like (D:picking logs\)as the info in D1, then every time i run the macro you just gave me it just saves it to that? if that idea works do you know the macro to make it happen


    Test 11.xlsm

  7. #7
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: VBA code that will save anytime sheet is updated and..

    Hello,

    I think this will do the trick. Change the appropriate sections to fit your needs.

    Please Login or Register  to view this content.
    Thanks

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

    Re: VBA code that will save anytime sheet is updated and..

    Do i paste this into the sheet or into a module?

  9. #9
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: VBA code that will save anytime sheet is updated and..

    Replace it with what was in the sheet.

    Thanks

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

    Re: VBA code that will save anytime sheet is updated and..

    I entered the VBA into the workbook and keeps highlighting the below line in the code.
    ThisWorkbook.SaveAs Filename:=txtFileName


    TEST21.xlsm

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

    Re: VBA code that will save anytime sheet is updated and..

    in my last reply i added the workbook with your code installed maybe you could check it out.

  12. #12
    Valued Forum Contributor fredlo2010's Avatar
    Join Date
    07-04-2012
    Location
    Miami, United States
    MS-Off Ver
    Excel 365
    Posts
    762

    Re: VBA code that will save anytime sheet is updated and..

    Hello,

    The code under the workbook is not close to the code I provided. This is what was there

    Please Login or Register  to view this content.

    The code was supposed to be the codes from Post #2 and Post #7 I fixed it for you and also modified it to fit your needs ( change the saving location) I also fixed the extension to save it as an ".xls" I added another layer of security in case the folder does not exists

    This is the final under Sheet1 Module:

    Please Login or Register  to view this content.
    Here is the final file

    Attachment 263835

    Thanks

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

    Re: VBA code that will save anytime sheet is updated and..

    WOW this is amazing thanks so much for your help.

+ 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. VBA code to save excel sheet twice a day
    By jhevan50 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-13-2012, 07:05 AM
  2. Replies: 8
    Last Post: 06-16-2011, 11:49 AM
  3. VBA Save as - save 1 sheet and no code?
    By ker9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2010, 01:21 PM
  4. Rev. Auto Updated when sheet is updated and or entire book
    By frankee_gee in forum Excel General
    Replies: 1
    Last Post: 04-07-2008, 05:05 PM
  5. VBA code to save only a sheet under a unique name
    By Jlong1980 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-30-2006, 10:03 PM

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