+ Reply to Thread
Results 1 to 17 of 17

VBA to clear items for bank rec with a unique reference and move to other sheet?

  1. #1
    Forum Contributor
    Join Date
    01-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    147

    VBA to clear items for bank rec with a unique reference and move to other sheet?

    Hi there,

    I am new to VBA and now have a bank rec with matching items by the reference but with a different date, therefore the list is always getting bigger.

    Is there a easy way to match off items from 2 lists in one tab?

    e.g. Date in column A, reference in column B, amount in column C for 1 list
    Date in column E, refererence in column F, amount in column G for list comparing the above 2.

    The references should be the same.

    Ideally it would be nice to match of the items and move them to another tab?

    Is this possible? Your help would be much appreciated.

    Regards

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Is the amount in Col C the same as in Col G if the reference numbers are the same. What actions if they are not the same? I'm sure that it can be accomplished once we understand the exception issue if there is one.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    01-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Hi there,
    Yes the references and amounts are the same. If they are not the same, leave as it is, i.e. not remove the reference / amounts to another sheet.
    Hope you can help?

  4. #4
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Where is the 2nd list shown? Is that to the right of the list 1? We need to know so as not delete items off of list 2 when removing from list 1.

    Ie, is it ok to delete the entire row, or do you need to delete and shift data up?

  5. #5
    Forum Contributor
    Join Date
    01-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    2nd list is on same sheet, i.e. to the right of list 1.
    Therefore you would be right to say shift data up.

    Regards

  6. #6
    Forum Contributor
    Join Date
    01-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Hi there all,
    Does anyone have any ideas on how to do the above please?
    I am stuck!

    Regards

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    If you upload a sample workbook with before/after format, it will help to us understand what you are really trying to do.

  8. #8
    Forum Contributor
    Join Date
    01-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Hi there,
    Please see attached for a sample.
    So for example, details in cells B104 and C104 match against F and G21 (date being different).
    Details in B and C 106 match against F and G22.

    Therfore I would want to remove these cells into another tab, i.e. match off.

    Regards



    I hope this is clear?
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Prepare a back up file and try the code.
    See if this is how you wanted...
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    01-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Sorry if this is not a good question, but being new to VBA, can you guide how I enter the code into the sheet?

    Regards

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    OK, file attached.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    01-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Hi there,
    thanks for this. Can I ask how and where you entered the code?
    There is a downside though which I hope you can help.
    You will have noticed the bottom of the spreadsheet does not align after the cells have been removed.
    i.e. headings in A-D do not align with headings in E-H. Is there a way to keep this aligned as well?
    If not, maybe a code to highlight all references and amounts that match, or if you can suggest anything better?
    Thanks for all your help again,

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    1) to see the code, hit Alt + F11, if you can not see the code, d-click on Mudule1 on the left payne.

    2) That's what I was thinking...

  14. #14
    Forum Contributor
    Join Date
    01-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Is there a way around this? i.e keep the headings aligned?

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Try replace the code with following and see if this is OK.
    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    01-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    Seems to have worked perfectly for the sample worksheet.
    Thanks so much. Will reply again if problems occur on the actual sheet!
    Thanks again

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA to clear items for bank rec with a unique reference and move to other sheet?

    OK, just post back if any problem.

    As you have experienced here, if we have a sample workbook to work with, you will normally get the response quicker....

+ 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] Count Unique Items in a Column Based on Unique Items in Two Other Columns
    By HangMan in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-31-2015, 04:48 PM
  2. Auto Recon match Bank items
    By jasperj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-06-2015, 11:49 AM
  3. Macro that will move items marked with x with another sheet
    By geliedee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2014, 05:16 PM
  4. Replies: 3
    Last Post: 09-03-2014, 09:32 AM
  5. [SOLVED] Macro to move items on one sheet to the bottom of another
    By mcranda in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-26-2013, 02:56 PM
  6. Split Data Unique Value From 2 Sheet of A column and Move to 2 Sheet with Splited Values
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2013, 04:21 AM
  7. Clear out all rows and move them to a corresponding sheet on the same workbook
    By ldorsi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2011, 01:13 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