AD_Taylor
Well-known Member
- Joined
- May 19, 2011
- Messages
- 687
Is there a particular reason when using the Split function that you can't assign the result to a variable already created as an array?
For instance with the active cell having this value:
cat/dog/moose/badger/wild boar
I tried to do something like this:
But something like this actually worked and created an array?
Seems to spoil my convention a bit, which is to list all variables at the top of the code so by quickly scrolling up I can see what variables are what type and which are arrays and which are not.
For instance with the active cell having this value:
cat/dog/moose/badger/wild boar
I tried to do something like this:
Code:
Sub prSplit()
Dim arr() As Variant
arr = Split(ActiveCell.Value, "/")
End Sub
But something like this actually worked and created an array?
Code:
Sub prSplit()
Dim str As Variant
str = Split(ActiveCell.Value, "/")
End Sub
Seems to spoil my convention a bit, which is to list all variables at the top of the code so by quickly scrolling up I can see what variables are what type and which are arrays and which are not.