+ Reply to Thread
Results 1 to 4 of 4

Combining data in several rows if a condition is met.

  1. #1
    Registered User
    Join Date
    02-22-2007
    Posts
    10

    Combining data in several rows if a condition is met.

    Hi there - back with another query!

    I am trying to tidy up bank statements which have been subjected to OCR and saved in Excel. Due to the way the original statements are laid out, some of the transactions have details over several rows (could be two, three or more).

    I need a macro/formula to do is combine the data so there is only one line per transaction.

    In the attached example, the formula or macro should recognise if there is a blank cell in Column A at the start of the row and if this is the case combine the contents of the cells on the rest of that row and all the rows below it (until it comes across another row with an entry in Column A) with the last row above which didn't have a blank cell at the start of it.

    I've probably not explained myself very well so have attached an example of the data I'm working with and what I'm trying to achieve.

    Your help is much appreciated as always,

    Ian
    Attached Files Attached Files
    Last edited by kingcal; 06-05-2011 at 03:22 PM. Reason: typo!

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Combining data in several rows if a condition is met.

    hi, Ian, please check attachment, run code "test"
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Combining data in several rows if a condition is met.

    Hi Ian;

    Watersev posted his solution while I was creating mine, but I'll post mine anyway.

    I have not tested this so back up before trying it.

    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combining data in several rows if a condition is met.

    Hi,

    One way

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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