This should do what you want.
VB:Sub test() Dim headerRow As Range With ThisWorkbook.Sheets("sheet1").Range("E:E"): Rem adjust Set headerRow = .Rows(2): Rem adjust With Range(.Cells(headerRow.Row + 1, 1), .Cells(.Rows.Count, 1).End(xlUp)) With .Offset(0, 2) .FormulaR1C1 = "=TRIM(CLEAN(RC[-2]))" .Value = .Value .TextToColumns Destination:=.Cells(1, 1), DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _ Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo:=Array(1, 1) With Application.Intersect(headerRow.EntireRow, .CurrentRegion.EntireColumn) .FormulaArray = "=COLUMN(1:1)" .Value = .Value End With End With End With End With End Sub


Reply With Quote

Bookmarks