+ Reply to Thread
Results 1 to 8 of 8

copy sheet data at the end of the month

  1. #1
    Registered User
    Join Date
    12-28-2017
    Location
    varna
    MS-Off Ver
    2016
    Posts
    21

    copy sheet data at the end of the month

    Hello all,

    My goal is this: I have a tracker file with lots of formulas and dates, based on today date. I am looking for a way to make a copy of this sheet with values only on a specific date and time (lets say 23:59 on the last day of the month) in order to keep a log. Is this possible to be done at all and how?

    Thanks in advance!

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: copy sheet data at the end of the month

    Is your computer power on 24/7?
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    12-28-2017
    Location
    varna
    MS-Off Ver
    2016
    Posts
    21

    Re: copy sheet data at the end of the month

    Yes, it is. Anyway can set another time to avoid any errors.

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: copy sheet data at the end of the month

    The easy way would be to use the task scheduler built into Windows.

    In xl2007 and later

    1.Open the Control Panel.
    2.Open System and Security
    3.Open the Task Scheduler icon.Under Administrative Actions
    4.Select Scheduling method from the menu
    5.Follow the Wizard instructions.

    You would need a procedure in code module1 of your workbook to do the copying, You could substitute actual file and sheet name in the sample below.

    Sample macro:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-28-2017
    Location
    varna
    MS-Off Ver
    2016
    Posts
    21

    Re: copy sheet data at the end of the month

    Thank you JLGWhiz. This looks interesting, but does not fill my requirements as i would like to use only VBA. In order to get the desired result, maybe i can just leave the workbook open (to avoid using task scheduler, pc will be locked tho) and add some code to save a copy with values only, save itself and close at some time? Thanks in advance.

  6. #6
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: copy sheet data at the end of the month

    If you closed the workbook at night and opened it daily in the morning before a certain time (say 10 AM) then you could use a workbook event could like the example below.

    Please Login or Register  to view this content.
    The code would be installed in the ThisWorkbook code module. Then on the first day of each month when the workbook is opened, it will run the code and copy your data over.

  7. #7
    Registered User
    Join Date
    12-28-2017
    Location
    varna
    MS-Off Ver
    2016
    Posts
    21

    Re: copy sheet data at the end of the month

    Thank you again JLGWhiz for your prompt reply and creative thinking. This is something i am trying to avoid as lot of the formulas depend on today(). So my other idea is to make this check on exit (some time range on last day of the month) and copy the file in a certain shared directory and overwrite existing one. This way i will have copy of the last saved version during the last day. Am i overcomplicating things or this makes sense?

  8. #8
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: copy sheet data at the end of the month

    I have been mentally running a scenario using the OnTime function and the EOMonth worksheet function to trigger the save action, but I cannot get it to gel into a logical result that would guarantee you file is saved on a monthly basis. If I do come up with something, I will post it to this thread. Meanwhile, you can hope that somebody smarter than me will pick up on the thread and offer a workable solution. There are problems with a self calling OnTime macro (I won't elaborate here) that can make them unreliable in a case like yours.
    Regards, JLG
    Last edited by JLGWhiz; 01-25-2019 at 11:53 AM.

+ 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. Replies: 1
    Last Post: 11-14-2018, 09:22 AM
  2. [SOLVED] copy cell data to another sheet based on month entered
    By steve400243 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2016, 02:48 PM
  3. [SOLVED] If cell equals month copy row to relevant month tab / sheet
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2015, 11:19 PM
  4. VBA code to copy data to another sheet depending on the month
    By kanyarat in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2015, 03:46 PM
  5. Make Copy of a Sheet each month to track data
    By kmanna in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2014, 01:02 PM
  6. copy and paste data month to month
    By hotrod4571 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-23-2013, 01:23 PM
  7. copy data from sheet with dates that are within a month
    By Danimarie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2012, 07:01 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