MrBartlett
New Member
- Joined
- Jul 22, 2018
- Messages
- 25
Hi all,
Below is my code:
What's the best way to have it skip values that have length <2?
Thanks!
Below is my code:
Code:
Sub RedistributeCommaDelimitedData()
Dim xArr() As String
Dim xAddress As String
Dim Rg As Range
Dim Rg1 As Range
On Error Resume Next
xAddress = Application.ActiveWindow.RangeSelection.Address
Set Rg = Application.InputBox("please select the data range:", xAddress, , , , , 8)
If Rg Is Nothing Then Exit Sub
Set Rg = Application.Intersect(Rg, Rg.Parent.UsedRange)
If Rg Is Nothing Then Exit Sub
Set Rg1 = Application.InputBox("please select output cell:", , , , , , 8)
If Rg1 Is Nothing Then Exit Sub
xArr = Split(Join(Application.Transpose(Rg.Value), ","), ",")
Rg1.Resize(UBound(xArr) + 1) = Application.Transpose(xArr)
Rg1.Parent.Activate
Rg1.Resize(UBound(xArr) + 1).Select
End Sub
What's the best way to have it skip values that have length <2?
Thanks!