1 Attachment(s)
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
Code:
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