+ Reply to Thread
Results 1 to 14 of 14

Post date in office ledger from bank statement

Hybrid View

kv.singh Post date in office ledger... 01-14-2025, 04:36 AM
JohnTopley Re: Post date in office... 01-14-2025, 06:21 AM
kv.singh Re: Post date in office... 01-14-2025, 08:05 AM
bakerman2 Re: Post date in office... 01-14-2025, 08:21 AM
Sintek Re: Post date in office... 01-14-2025, 08:28 AM
Sintek Re: Post date in office... 01-14-2025, 08:30 AM
bakerman2 Re: Post date in office... 01-14-2025, 09:46 AM
Sintek Re: Post date in office... 01-14-2025, 10:00 AM
kv.singh Re: Post date in office... 01-14-2025, 11:06 AM
bakerman2 Re: Post date in office... 01-14-2025, 12:09 PM
kv.singh Re: Post date in office... 01-14-2025, 12:17 PM
bakerman2 Re: Post date in office... 01-14-2025, 12:31 PM
kv.singh Re: Post date in office... 01-14-2025, 01:16 PM
bakerman2 Re: Post date in office... 01-14-2025, 01:42 PM
  1. #1
    Forum Contributor
    Join Date
    10-30-2019
    Location
    GUJARAT,INDIA
    MS-Off Ver
    MS OFFICE 2016
    Posts
    233

    Post date in office ledger from bank statement

    I have office ledger in Column A to F (where I want to paste date)
    Data copied from bank statement is stored in two tables Table- 1 from column O to S and table-2 column U to AC
    If data in column D and E matches with data in column K and L then paste date mentioned in column H to column F(matching on two criteria)
    If data in column E matches with data in column AC paste date shown in column U to column F (matching on single criteria)
    Desired out put is marked with green color in column F

    I am sure to get solution from forum members.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,915

    Re: Post date in office ledger from bank statement

    The results in column F do not align with your data.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    10-30-2019
    Location
    GUJARAT,INDIA
    MS-Off Ver
    MS OFFICE 2016
    Posts
    233

    Re: Post date in office ledger from bank statement

    sorry for inconvenience. Now data updated in attached file.
    Attached Files Attached Files

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,357

    Re: Post date in office ledger from bank statement

    As JT already said, with data provided you can NEVER get the result in column F according to your criteria.
    Sub tst()
        T1 = Range("A4", Range("A" & Rows.Count).End(xlUp)).Resize(, 6)
        T2 = Range("H6", Range("H" & Rows.Count).End(xlUp)).Resize(, 5)
        T3 = Range("U7", Range("U" & Rows.Count).End(xlUp)).Resize(, 9)
        For i = 1 To UBound(T1)
            For ii = 1 To UBound(T2)
                If Join(Array(T1(i, 4), T1(i, 5)), "|") = Join(Array(T2(ii, 4), T2(ii, 5)), "|") Then
                    T1(i, 6) = T2(ii, 1)
                End If
            Next
            For j = 1 To UBound(T3)
                If T1(i, 5) = T3(j, 9) Then
                    If T1(i, 6) = vbNullString Then T1(i, 6) = T3(j, 1)
                End If
            Next
        Next
        Range("A4").Resize(UBound(T1), 6) = T1
    End Sub
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Post date in office ledger from bank statement

    Your output is still not correct...
    Sub J3v16()
    Dim Data, Chk, lr As Long, i As Long
    With ActiveSheet
        lr = .UsedRange.Row - 1 + .UsedRange.Rows.Count
        With .Range("A4:F" & .Cells(.Rows.Count, 1).End(xlUp).Row)
            Data = .Value
            For i = 1 To UBound(Data)
                Chk = Evaluate("=Match(" & Data(i, 4) & " & " & Data(i, 5) & ",K1:K" & lr & "&L1:L" & lr & ",0)")
                If IsError(Chk) Then
                    Chk = Evaluate("=Match(" & Data(i, 5) & ",AC1:AC" & lr & ",0)")
                    If Not IsError(Chk) Then Data(i, 6) = .Parent.Cells(Chk, 21)
                Else
                    Data(i, 6) = .Parent.Cells(Chk, 8).Value
                End If
            Next i
            .Value = Data
        End With
    End With
    End Sub
    @ bakerman2...I think it's time to start making use of Option Explicit lol...
    Last edited by Sintek; 01-14-2025 at 09:14 AM. Reason: Updated Code...
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  6. #6
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Post date in office ledger from bank statement

    ...Deleted...
    Last edited by Sintek; 01-14-2025 at 08:33 AM.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,357

    Re: Post date in office ledger from bank statement

    Steven, as long as we get the same result...

  8. #8
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Post date in office ledger from bank statement

    @ Rudi...just wondering why you never declare variables...

  9. #9
    Forum Contributor
    Join Date
    10-30-2019
    Location
    GUJARAT,INDIA
    MS-Off Ver
    MS OFFICE 2016
    Posts
    233

    Re: Post date in office ledger from bank statement

    Thanks @John, @ Bakerman2 @ Sintek code is giving desired results.
    One more favor please . I want to create code which will move all data from A4 to F4 to Sheet "date-post"
    Then when I repeat code execution, data from A4 to F4 is moved to Sheet "date-post" below earlier moved data
    after leaving two blank row above. Refer attached file

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,357

    Re: Post date in office ledger from bank statement

    No file attached.

  11. #11
    Forum Contributor
    Join Date
    10-30-2019
    Location
    GUJARAT,INDIA
    MS-Off Ver
    MS OFFICE 2016
    Posts
    233

    Re: Post date in office ledger from bank statement

    file attached
    Attached Files Attached Files

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,357

    Re: Post date in office ledger from bank statement

    Sub tst()
        With Sheets("Sheet3")
            T1 = .Range("A4", .Range("A" & .Rows.Count).End(xlUp)).Resize(, 6)
            T2 = .Range("H6", .Range("H" & .Rows.Count).End(xlUp)).Resize(, 5)
            T3 = .Range("U7", .Range("U" & .Rows.Count).End(xlUp)).Resize(, 9)
        End With
        For i = 1 To UBound(T1)
            For ii = 1 To UBound(T2)
                If Join(Array(T1(i, 4), T1(i, 5)), "|") = Join(Array(T2(ii, 4), T2(ii, 5)), "|") Then
                    T1(i, 6) = T2(ii, 1)
                End If
            Next
            For j = 1 To UBound(T3)
                If T1(i, 5) = T3(j, 9) Then
                    If T1(i, 6) = vbNullString Then T1(i, 6) = T3(j, 1)
                End If
            Next
        Next
        With Sheets("date-post")
            lRow = .Range("A" & .Rows.Count).End(xlUp).Row
            .Range("A" & .Rows.Count).End(xlUp).Offset(IIf(lRow = 1, 1, 3)).Resize(UBound(T1), 6) = T1
        End With
        With Sheets("Sheet3")
            .Range("A4", .Range("A" & .Rows.Count).End(xlUp)).Resize(, 6).ClearContents
        End With
    End Sub

  13. #13
    Forum Contributor
    Join Date
    10-30-2019
    Location
    GUJARAT,INDIA
    MS-Off Ver
    MS OFFICE 2016
    Posts
    233

    Re: Post date in office ledger from bank statement

    Thanks once again @Bakermen
    I really appreciate all forum members. I always get help from this forum.

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,357

    Re: Post date in office ledger from bank statement

    You're welcome.

    You may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Date-wise Bank Balance Statement required
    By btparkhe1920 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-09-2024, 01:10 PM
  2. Replies: 1
    Last Post: 05-14-2021, 11:16 AM
  3. [SOLVED] COMBINING Revenue and Expenses to construct a excel bank ledger
    By sunboy in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 05-03-2021, 11:25 AM
  4. [SOLVED] Date Formatting - data from bank statement
    By Alexthelm in forum Excel General
    Replies: 8
    Last Post: 08-14-2019, 09:50 AM
  5. [SOLVED] Post bank transactions to bank Recon as individual amounts instead of sums
    By SjMaxwell in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-16-2018, 03:15 AM
  6. Replies: 2
    Last Post: 03-28-2016, 02:46 AM
  7. [SOLVED] Excel 2007 : Find bank balance in bank statement
    By Baldev Kumar in forum Excel General
    Replies: 5
    Last Post: 07-05-2012, 02:58 PM

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