Split row into multiply rows based on combined values in a cell and then make the values unique
Hi Johan,
Am Wed, 20 Mar 2019 21:44:35 +0100 schrieb Claus Busch:
Sub Test()
Dim varData As Variant
Dim LRow As Long
Dim strTmp As String
if you have an older version of Excel where TEXTJOIN doesn't work, try:
Sub Test2()
Dim varOut As Variant, varTmp As Variant
Dim LRow As Long
Dim strTmp As String
'Modify sheet name here
With Sheets("Sheet1")
LRow = .Cells(.Rows.Count, 1).End(xlUp).Row
varTmp = Application.Transpose(.Range("A1:A" & LRow))
strTmp = Join(varTmp, ";")
varOut = Split(strTmp, ";")
.Range("A1").Resize(UBound(varOut) + 1) =
Application.Transpose(varOut)
End With
End Sub
Regards
Claus B.
--
Windows10
Office 2016
|