+ Reply to Thread
Results 1 to 20 of 20

Copying cell data from one sheet to another based on date.

  1. #1
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Copying cell data from one sheet to another based on date.

    this is similar to another just posted, but not quite. I have cells I want copied from one sheet to another based on the date on the first sheet (sheet St. J - DWR cell L6). Cells to copy are Sheet St. J cells C34:G34 (and others). They will be copied to a second sheet called totals, and be copied to the cells under today's date.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    Your data are riddled with meged cells and wrong match. Evenif I trim it, 91L does not match with 91 L. I have unmerged cells and have manually corrected the words in sheet Totals.
    For the code to work,employee numbers on borh sheet should match.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    Thank you. That gets the data copied to the first range on the 'totals' sheet. How do I tweak it to be copied under the correct date on the 'totals' sheet? No matter what date is in the 'St.J DWR' (L6) cell, it only copies to the first place on 'totals', not under the correct date. It looks like the code is trying to find the correct date...

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    Attach a sample output.

  5. #5
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    See Attached.

  6. #6
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    I'm also confused by your comment that employee numbers on both sheets should match, as employee info is only on one sheet.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    Try to match column B of St. J DWR with column C of Totals.
    What are these numbers?
    91 L
    91 R
    93 L
    93 R

    91L
    91R
    93L
    93R
    VT 5
    VT 2E
    VT 2B
    BSA
    COR

    If you were not trying to match both these columns, it is a wrong code and just forget the code.

  8. #8
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    Yes, I'm trying to match those columns. They should be the same on both sheets. They are road numbers in our area, and I want to record data from each day over to the 'totals' sheet.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    Are they the same?

  10. #10
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    Yes, these should be the same on both sheets.

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    As I said in my first post, 91L is not equal to 91 L
    Try it yourself.
    I have to use the trim function to remove the space.

  12. #12
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    It looks like they are the same, with spaces. I removed the spaces and tried again, but the data fills the first area, not under the correct date, on the totals sheet.
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    I have adjusted the code. The only issue left now is if you want to clear existing data. If you do not want, please remove this line from the code.
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    Thank you. Can I copy some of the code to move the right side of the St. J DWR sheet over to the 'totals' sheet? I'm referring to the data for RT 5, RT 2E, RT 2B, BSA, and COR. ? Or will that need to be added separately?

  15. #15
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    This requires to completley write the code from a scratch. I will do it in a couple of hours.

  16. #16
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    Try the attached.
    If the two codes do not match the code will not work. COR and COR. ARE NOT THE SAME

  17. #17
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    Works great, except it doesn't pick up the three starting with 'VT' That's VT 5, VT 2E and VT 2B. They look the same, both have spaces in them. Shall I remove spaces and try?

    91 L 3 3.5 2.25 0 0
    91 R 0 0 0 0 0
    93 L 1 1 0 0 0
    93 R 1 1.5 0 0 0
    VT 5
    VT 2E
    VT 2B
    BSA 1 1 0 0 0
    COR. 1 0 1.5 0 0
    Last edited by Skeeterj; 01-07-2014 at 03:39 PM.

  18. #18
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    I was going say the same! I had this expereince a while back.

  19. #19
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    Duh!!! Geez. Just realized they aren't the same!!! I'll modify that and try again. My bad. Thank you VERY MUCH for your assistance with this. It's been a number of years since I was doing any serious spreadsheet work. It's nice to be back into it.
    Last edited by Skeeterj; 01-07-2014 at 03:58 PM.

  20. #20
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copying cell data from one sheet to another based on date.

    I have now included a Trim function which removes the spaces in both sheets, but the trim will not remove a "DOT". COR.
    and COR will not be the same.
    Last edited by AB33; 01-07-2014 at 04:13 PM.

  21. #21
    Registered User
    Join Date
    01-03-2011
    Location
    Vermont
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying cell data from one sheet to another based on date.

    Thank you again, VERY MUCH!

+ 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. Need help copying cells to another sheet based on the date
    By MP3265 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2013, 01:46 AM
  2. Copying data from one sheet to another based on cell color
    By Redcarn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2012, 03:16 AM
  3. Replies: 0
    Last Post: 03-27-2012, 04:54 PM
  4. Replies: 4
    Last Post: 03-22-2011, 02:26 AM
  5. Copying data from one sheet to another based on variable date range
    By Colin1226 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2010, 02:38 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