Only copy rows based on cell value and Paste (values only) into a new table. BankReconciliation Project.

Spotycus

New Member
Joined
Dec 8, 2015
Messages
25
I have seen this topic a lot recently but have not been able to apply the prior examples correctly for my scenario. I am working on a bank reconciliation tool, and need generating the table of mismatched or unreconciled values. Hopefully the following information will help explain.

bank-rec-1.png

I have two tables of information QBOTransactions and BankTranasactions that have share the same formatting including headers. The Unique Column ensures that there are no two transactions within the same table that identical. The letter helps to signify the type of transaction as well. The Matched column uses the following formula to compare the unique codes between the two tables to reconcile the transactions.

Code:
=IF(COUNTIF($BP$195:$BP$316,BD195)=1,"R","")

Based on the value in the Matched Columns I would like to copy the transactions that DO NOT have an R to new tables. QBOTransactions would be copied to QBOUncleared and BankTransactions would be copied to BankUncleared . Below is an example of the desired outcome

bank-rec2.png

I know it can be difficult to obtain help when only providing pictures so I will provide the other vital information below. Although I am still progressing my knowledge of VBA, I do feel rather comfortable changing values to match my specific range or cell locations. I just do not know how to best transfer the information from one table to the other so that it is organized by the date and then highlighting the errors. If it helps with the conditional formatting, the Unique value will point out the problem area (94.75 = transaction amount -E= transaction type)

Code:
Sheets= Sheet1 (Bank Reconciliation)
QBOTransactions Table= ($AX$194:$BE311)
BankTransactions Table= ($BJ$194:$BQ311)
QBOUncleared Table= ($C$9:$J30)
BankUncleared Table= ($M$9:$T30)

Thanks in advance for any advice or help!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
There might be a faster way to do it, but this seems to work.
Code:
Sub unreconcld()
Dim sh As Worksheet, c As Range
Set sh = Sheets("Sheet1")
    With sh
    For Each c In .Range("BE195:BE311")
        If c <> "R" Then
            c.Offset(, -6).Resize(1, 4).Copy .Cells(Rows.Count, 3).End(xlUp)(2)
            If c.Offset(, -5) = "Check" Then
                .Cells(Rows.Count, 3).End(xlUp)(1, 5) = c.Offset(, -2).Value
            ElseIf c.Offset(, -5) = "Expense" Then
                .Cells(Rows.Count, 3).End(xlUp)(1, 6) = c.Offset(, -2).Value
            ElseIf c.Offset(, -5) = "Deposit" Then
                .Cells(Rows.Count, 3).End(xlUp)(1, 7) = c.Offset(, -2).Value
            End If
            .Cells(Rows.Count, 3).End(xlUp)(1, 8) = c.Offset(, -1).Value
        End If
    Next
    For Each c In .Range("BQ195:BQ311")
        If c <> "R" Then
            c.Offset(, -6).Resize(1, 4).Copy .Cells(Rows.Count, 13).End(xlUp)(2)
            If c.Offset(, -5) = "Check" Then
                .Cells(Rows.Count, 13).End(xlUp)(1, 5) = c.Offset(, -2).Value
            ElseIf c.Offset(, -5) = "Expense" Then
                .Cells(Rows.Count, 13).End(xlUp)(1, 6) = c.Offset(, -2).Value
            ElseIf c.Offset(, -5) = "Deposit" Then
                .Cells(Rows.Count, 13).End(xlUp)(1, 7) = c.Offset(, -2).Value
            End If
            .Cells(Rows.Count, 13).End(xlUp)(1, 8) = c.Offset(, -1).Value
        End If
    Next
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,454
Members
448,898
Latest member
drewmorgan128

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top