+ Reply to Thread
Results 1 to 4 of 4

Copy-Paste based on date in cell

  1. #1
    Forum Contributor
    Join Date
    10-28-2009
    Location
    Portland, Maine
    MS-Off Ver
    Excel 2003
    Posts
    102

    Copy-Paste based on date in cell

    Hello,
    I have data on sheet-1 ("MEAL CHART") that I copy over to sheet-2 (Nutri_DB) daily. The macro below is working for me when I post the data the same day it is recorded. However, I frequently need to post my data the day before or day after it is recorded.

    I would like to modify my code below so it copies/pastes the data based on the date in cell B1 (Named range "DATE") not the actual date (today()).

    Nothing I try seems to work and I need some help! I've attached the spreadsheet with the my macro for those interested in helping.
    Thanks!

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by yunesm; 10-28-2009 at 04:39 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Copy-Paste based on date in cell

    Hello yunesm,

    Welcome to the Forum!

    To make your posts easier to read, copy, and edit please wrap your code. I did it for you this time. Here is how you can do it next time.

    How to wrap your Code
    1. Select all your code using the mouse.
    2. Click on the # icon on the toolbar in the Message window. This will automatically wrap the text you selected with the proper Code tags to create a Code Window in your post.

    Use the Bulletin Board Code Tags
    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] at the end of the last line.


    To learn more about BB codes used in this forum, just click on the link below...

    Bulletin Board Codes Tags
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Copy-Paste based on date in cell

    Hello yunesm,

    I have addede thie macro below to the attached workbook. I made the change to use the date in cell "B1" and cleaned the code up a bit.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    10-28-2009
    Location
    Portland, Maine
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: Copy-Paste based on date in cell

    Perfect. Thank you Leith!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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