+ Reply to Thread
Results 1 to 2 of 2

Code to paste as value when last data is less than today

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Code to paste as value when last data is less than today

    I have 2 tab. One is Daily Forcast, one is Actual. Currently, we type in our Forcast amount in the Actual tab. Then everyday, when we see our bank statement for yesterday, we copy and paste yesterday as value in the Daily Forcast to keep a record. Then we would overwrite the value in Actual Tab.

    However, i hope to have a code that will copy and paste the value up to yesterday when i open my file first time today. I mean let say today is 08/04, and my last data in Daily Forcast is up to 05/04. When i open the file, it will copy and paste as value from Actual tab to daily forcast tab 06/04-07/04.
    Then tomorrow, 09/04, when i open my file in the morning, it will copy and paste 08/04 n paste as value in Daily Forcast tab.
    Attached Files Attached Files

  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: Code to paste as value when last data is less than today

    this is workbook event code which will run when the workbook is opened. So that it will only execute once per day, when it runs and executes a copy and paste action a "C" will be placed in row 2 for that date. This will then prevent the code from executing any further copy actions for that day in case the workbook is closed and reopened.
    Please Login or Register  to view this content.
    Copy and paste the code to the 'ThisWorkbook' code module.
    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!

+ 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] Macro for copy paste into TODAY col
    By roborob9 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-22-2016, 08:15 AM
  2. Please help me with VBA code to stop data updating using today's date.
    By Vickymabo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-10-2015, 05:54 PM
  3. Looking for VBA code to stop data updating using today's date.
    By Vickymabo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2015, 02:34 PM
  4. Looking for VBA code to stop data updating using today's date.
    By Vickymabo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2015, 02:30 PM
  5. Create new sheet named today's date and paste existing data into the sheet
    By kmao2004 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2014, 06:35 PM
  6. Replies: 5
    Last Post: 09-09-2014, 10:57 PM
  7. [SOLVED] Code to auto filter three month segments of data from today's date
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2012, 04:51 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