Sub MakeTheList()
Dim arr As Variant
Dim r As Long, c As Long
Dim DestR As Long
Dim Countries As Variant
arr = ActiveSheet.UsedRange.Value
Worksheets.Add
[a1:e1] = Array("Country Code", "date", "value", "points", "City Code")
DestR = 1
For r = 2 To UBound(arr, 1)
If arr(r, 5) = "" Then
Cells(DestR, 1) = arr(r, 1)
Cells(DestR, 2) = arr(r, 2)
Cells(DestR, 3) = arr(r, 3)
Cells(DestR, 4) = arr(r, 4)
Cells(DestR, 5) = arr(r, 5)
End If
Countries = Split(arr(r, 5), ",")
For c = 0 To UBound(Countries)
DestR = DestR + 1
Cells(DestR, 1) = arr(r, 1)
Cells(DestR, 2) = arr(r, 2)
Cells(DestR, 3) = arr(r, 3)
Cells(DestR, 4) = arr(r, 4)
Cells(DestR, 5) = Trim(Countries(c))
Next
Next
End Sub
Problem.xlsx
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE