+ Reply to Thread
Results 1 to 3 of 3

Combine rows based on blank columns

Hybrid View

  1. #1
    Registered User
    Join Date
    07-23-2008
    Location
    Btizzy
    Posts
    5

    Combine rows based on blank columns

    Hi,

    I have been browsing this forum for quite a while and have found it extremely useful but have never had the need to post a question until now. Being that my VBA skills are still in development I was wondering if anyone could assist me a problem I am encountering.

    Column A is populated with either names or fragments of sentences. In column B, all the names have a corresponding number associated with them and the sentences have a blank cell. The sentences below the names are information about the names. What I need to do is combine the sentences and output that result into Column C of the name above it.

    I have tried to loop based off of the blank cells but have been unsuccessful in my attempts. I have attached a sample sheet showing the problem. Thank you in advance for any help you can give me.

    -Steve
    Attached Files Attached Files
    Last edited by motomoto1; 03-29-2010 at 10:24 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Combine rows based on blank columns

    Not quite sure what you are trying to acheive but the following macro will build split sentences into single ones.

    Sub Test()
    For N = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
        If Cells(N, 2) = "" And Cells(N - 1, 2) = "" Then
            Cells(N - 1, 1) = Cells(N - 1, 1) & " " & Cells(N, 1)
            Rows(N).Delete
        End If
    Next N
    End Sub
    Martin

  3. #3
    Registered User
    Join Date
    07-23-2008
    Location
    Btizzy
    Posts
    5

    Re: Combine rows based on blank columns

    Much appreciated mrice.....this is exactly what I was looking for. Thank you for taking the time to help.

+ 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