Consulting

Results 1 to 8 of 8

Thread: combine values from multiple columns into a single cell in column

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location

    combine values from multiple columns into a single cell in column

    I need a VBA code that can combine values from multiple columns into a single column that mean if i have a data on column A2-A3-A4-A30-AA-AB... combine all of them into A1 i have this VBA code but it is not work on my data, because the column A is empty . i attached a sample file enclosed this post.

    Thank you for your help


    Sub Comb() 
    Dim i As Long 
    For i = 1 To Range("A" & Rows.count).end(xlup).row Step 1 
        For x = 2 To 256 
        If Cells(i, x).Value = "" Then 
        Else 
        Cells(i, 1).Value = Cells(i, 1).Value & ", " & Cells(i, x).Value 
        End If 
        Next x 
    Next i 
    End Sub
    Attached Files Attached Files
    Last edited by parscon; 11-28-2013 at 12:17 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •