Home > OS >  Split From Right to Left
Split From Right to Left

Time:12-12

my code so far has worked for split

How can I split it from right to left?

Sub try()
Dim size As String
Dim ResultSize() As String
Dim i As Integer
Dim MaxSize As Integer

size = "36;37;38;39"
ResultSize = Split(size, ";")
MaxSize = UBound(ResultSize)

For i = 0 To MaxSize
  Debug.Print ResultSize(i)
Next i

End Sub

CodePudding user response:

You may try it like this

Sub try()
Dim size As String
Dim ResultSize() As String
Dim i As Integer
Dim MaxSize As Integer

size = "36;37;38;39"
ResultSize = Split(size, ";")
MaxSize = UBound(ResultSize)

For i = MaxSize to 0 Step -1
  Debug.Print ResultSize(i)
Next i

End Sub
  • Related