I am trying to pull array info from FYI sheet so that I can change breaks as needed and then do text to column on Data tab. But it is not working getting Run time error. Can you help me how to get break points from one sheet and then apply text to column in second sheet with data?
Sub txtclm()
Sheets("FYI").Select
a = "Array(Array(0, 2),"
c = Cells(2, 1).End(xlDown).Row
For i = 2 To c
If i <> c Then
a = a & " Array(" & Cells(i, 2) & ", 2),"
Else
a = a & " Array(" & Cells(i, 2) & ", 2))"
End If
Next i
Sheets("Data").Select
Range("A:A").TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=a
End Sub
Sub txtclm()
Sheets("FYI").Select
a = "Array(Array(0, 2),"
c = Cells(2, 1).End(xlDown).Row
For i = 2 To c
If i <> c Then
a = a & " Array(" & Cells(i, 2) & ", 2),"
Else
a = a & " Array(" & Cells(i, 2) & ", 2))"
End If
Next i
Sheets("Data").Select
Range("A:A").TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=a
End Sub