Results 1 to 13 of 13

Concatenate With Loop Through 2 Columns of Information

Threaded View

  1. #1
    Registered User
    Join Date
    05-22-2014
    Posts
    11

    Concatenate With Loop Through 2 Columns of Information

    Hi Thanks for any help in advance.
    I have a list of names with blank cells in Column A cell 2.
    I want the programme to scroll through this column until it finds a name, when it does I want it to look in cell offset(1, 1), in this case B3 to see if there is a number. I want this number to be moved to offset (0, 1) AND any subsequent numbers below it until the next blank cell in that column (B).
    In the attached image cell B2 will contain all numbers in cells B3:B9 with a / between them. Cell B10 will have number from B11 and B12 will have B13:B15. If there is no number it will just continue to the next name in column A. My rough code below delivered the first number only in the relevant cell and I'm not clever enough to get it right. It does not have to be super slick as it's for one time use. Again thank you ;-)
    Sorry forgot to say I need numbers in column B cleared as they are concatenated into the single cell.

    Spreadsheet.jpg
    
    Sub Concatene()
    Dim rng As Long
    Dim r As Integer
    
      For r = 2 To 9440
     Cells(r, 1).Select
     If Selection <> "" Then If Selection.Offset(1, 1) <> 0 Then Selection.Offset(0, 1) = Selection.Offset(0, 1) & "/" & Selection.Offset(1, 1)
     
     Next
     
    End Sub
    Last edited by nigelld; 05-28-2014 at 06:54 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Nested loop to concatenate 2 columns of data
    By JohnnyBGood in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-15-2015, 07:42 AM
  2. Concatenate columns with information base on user selection
    By gward2701 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-05-2012, 09:55 PM
  3. [SOLVED] Return row 1 information if selected and concatenate
    By rmack1272 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-07-2012, 02:54 PM
  4. Replies: 0
    Last Post: 08-20-2012, 12:10 PM
  5. Replies: 8
    Last Post: 08-06-2012, 09: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