ValerieT
03-03-2015, 09:33 AM
I try to learn the Split function but I am stuck.
I would like to copya list of IDs (in a string) into a column with one single Id per cells
example: "1;2;3" becomes:
1
2
3
I've read something but can't apply it (you don't have to follow this way if you know better)
String "1; 2; 3; 4; 5; 6;" is in Cells(1,1)
and the separator ";" indicated in cells (2,1) (can be various like ";" or "," or "|") so I guess it is easier to ask the user to indicate it?
Sub_Test
Dim My_Tex As String
Dim My_Sepa As String
Dim My_ID() As String
My_Tex = Cells(1, 1)
My_Sepa = Cells(2, 1)
My_ID() = Split(My_Tex, My_Sepa)
For i = LBound(My_ID()) To UBound(My_ID())
x= My_ID(i)
'then I get stuck !
Next i
End_Sub
I would like to copya list of IDs (in a string) into a column with one single Id per cells
example: "1;2;3" becomes:
1
2
3
I've read something but can't apply it (you don't have to follow this way if you know better)
String "1; 2; 3; 4; 5; 6;" is in Cells(1,1)
and the separator ";" indicated in cells (2,1) (can be various like ";" or "," or "|") so I guess it is easier to ask the user to indicate it?
Sub_Test
Dim My_Tex As String
Dim My_Sepa As String
Dim My_ID() As String
My_Tex = Cells(1, 1)
My_Sepa = Cells(2, 1)
My_ID() = Split(My_Tex, My_Sepa)
For i = LBound(My_ID()) To UBound(My_ID())
x= My_ID(i)
'then I get stuck !
Next i
End_Sub