B
bernh.wagner
Hi all!
I need to combine several row values into one cell. In an older thread I found the macro below:
Sub ReallyBigRow()
''take a column of cells and put all into one big row separated by commas
''originally posted by John Wilson
Dim Lastrow As Long
Dim cell As Range
Dim DataRng As Range
Dim strRow As String
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set DataRng = Range("A1:A" & Lastrow)
For Each cell In DataRng
strRow = strRow & cell.Value & ","
Next cell
Range("B1").Value = strRow
End Sub
This works fine for complete rows (ex. A1:A25). However I would need the same function for a row with active filter (ex. A1,A3,A22,A24 visible).
Any idea someone how I could achieve that?
Thanks
I need to combine several row values into one cell. In an older thread I found the macro below:
Sub ReallyBigRow()
''take a column of cells and put all into one big row separated by commas
''originally posted by John Wilson
Dim Lastrow As Long
Dim cell As Range
Dim DataRng As Range
Dim strRow As String
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set DataRng = Range("A1:A" & Lastrow)
For Each cell In DataRng
strRow = strRow & cell.Value & ","
Next cell
Range("B1").Value = strRow
End Sub
This works fine for complete rows (ex. A1:A25). However I would need the same function for a row with active filter (ex. A1,A3,A22,A24 visible).
Any idea someone how I could achieve that?
Thanks