+ Reply to Thread
Results 1 to 14 of 14

How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

  1. #1
    Registered User
    Join Date
    04-05-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    13

    Unhappy How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    How to write macro that would match the first sheet's date with the other sheet's date then counter checking the amount (if date and amount are the same) then it would copy the whole data from the 2nd sheet beside the first sheet data (that had matched)

    I wrote something that goes like this:

    Please Login or Register  to view this content.
    but i think it's not working..
    Attached Files Attached Files
    Last edited by ims0phie; 04-21-2013 at 08:57 AM.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: How to match date from sheet1 with sheet2 data with the same date

    Hi,

    could you provide some sample data?

    Reards
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    04-05-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to match date from sheet1 with sheet2 data with the same date

    I tried editing my post.. can you help me with it?
    This is just a sample data, I'm trying to do some script that would enable to help me with my reconciliation on bank data and book records..

    I already have the code for matching the check..
    the only problem is the other one..
    the one that does not have check numbers..
    the only way to match those are through date and amount (since it does not have any check numbers)..

    I hope you could help me with this..
    Last edited by ims0phie; 04-21-2013 at 09:37 AM.

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    Hi,

    try this:
    Please Login or Register  to view this content.
    Regards

  5. #5
    Registered User
    Join Date
    04-05-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    Quote Originally Posted by tehneXus View Post
    Hi,

    try this:
    Please Login or Register  to view this content.
    Regards
    umm.. what is Option Explicit for?

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

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    Try the attached
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-05-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    Quote Originally Posted by AB33 View Post
    Try the attached
    what's the other sheet does? if it was deleted, the script wont work..

    I'm kinda confuse..

  8. #8
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    Quote Originally Posted by ims0phie View Post
    umm.. what is Option Explicit for?
    it forces you to declare variables, nothing bad

    Regards

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

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    There is no other sheets. I just copied sheet1 as original to check my code and it works. The code deals with sheets1 and 2. Just delete the other sheets if you want.

  10. #10
    Registered User
    Join Date
    04-05-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    Quote Originally Posted by AB33 View Post
    There is no other sheets. I just copied sheet1 as original to check my code and it works. The code deals with sheets1 and 2. Just delete the other sheets if you want.
    wow.. Thanks! It's working.. but when i tried to transfer the code to my real document.. and just change the sheet name, its having some error..

    it says something like:

    Run time error '9':
    Subscript out of range
    Attached Files Attached Files
    Last edited by ims0phie; 04-21-2013 at 11:20 AM.

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

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    It is not only you would have encountered out of range errors, but lots of others errors too. You not only have changed the layout of the sheets, but you have lots of hidden columns and merged cells. It took me a while to notice these changes.
    I have got two results sheets, but I believe the last one is the correct one. You have lots of empty cells in the amount column and If I were to include them on the code, I got some weird results. The correct sheet is sheet/13, but I have also include another sheet with zeros just to show you what you get if I were to include all amounts with zeros, hence I left them out.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    04-05-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    Quote Originally Posted by AB33 View Post
    It is not only you would have encountered out of range errors, but lots of others errors too. You not only have changed the layout of the sheets, but you have lots of hidden columns and merged cells. It took me a while to notice these changes.
    I have got two results sheets, but I believe the last one is the correct one. You have lots of empty cells in the amount column and If I were to include them on the code, I got some weird results. The correct sheet is sheet/13, but I have also include another sheet with zeros just to show you what you get if I were to include all amounts with zeros, hence I left them out.
    ohh.. thats not actually just empty cell, i just removed some confidential notes in it and just left the numbers in it.. actually first, i will locate the checks.. after the checks.. i'll be locating the ones that does not have check.. i already have the scripts for the ones that have checks.. i'm having trouble with the ones who's only basis is dates and amounts (in which case, it should not grab the ones with check even though date and amount matches it, since its a different mode of payment)..

    I'm really greatful for your help.. I'm still reviewing the script.. sorry if it's a little bit complicated.. I'm just hoping macro could help me lessen my job since i'm actually overloaded with one and i'm usually staying at the office untill 9 or 10pm while having a little time to sleep and relax..

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

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    Please do not reply with quote, just reply will do.
    I believe excluding zeros would be correct. If two cells have Blank, but have the same date, the code will treat them as a match and such would return a value, despite there is zero values on the credit side.

  14. #14
    Registered User
    Join Date
    04-05-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How to match Date and Amount from Sheet1 to Sheet2 with the same Date and Amount?

    ooh.. sorry.. I don't really know the effect of replying with quote or none..

    wow you do really know a lot.. how were you able to study this? I'm having hard time trying to understand the scripts..

    how can you make it cut and paste? instead of copy and paste? the previous script i had i was able to change copy from cut.. but from your script.. i don't see any copy script that i could replace it with cut..

+ 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