Private Sub Concatenate_20k_Rows()
Dim ws As Worksheet
Dim cell As Range
Dim LC As Long, i As Long
Set ws = ActiveSheet
For Each cell In ws.Range("A1:A20000")
LC = Cells(cell.Row, Columns.Count).End(xlToLeft).Column
For i = 1 To LC
cell.Value = cell.Value & " " & cell.Offset(0, i).Value
Next i
cell.Value = Application.Trim(cell.Value)
Next cell
End Sub
Option Explicit
Function LastRC(Worksht As String) As Long()
'Uncomment if on worksheet
'Application.Volatile
Dim WS As Worksheet, R As Range
Dim LastRow As Long, LastCol As Long
Dim L(1) As Long
Dim searchRng As Range
Set WS = Worksheets(Worksht)
Set searchRng = WS.Cells
With searchRng
Set R = .Cells.Find(what:="*", after:=.Cells(1, 1), _
LookIn:=xlFormulas, lookat:=xlPart, searchorder:=xlByRows, _
searchdirection:=xlPrevious)
If Not R Is Nothing Then
LastRow = R.Row
LastCol = .Cells.Find(what:="*", after:=.Cells(1, 1), _
LookIn:=xlFormulas, lookat:=xlPart, searchorder:=xlByColumns, _
searchdirection:=xlPrevious).Column
LastRow = 1
LastCol = 1
End If