I'm really new to VBA (10 hours) coming from a bit of a Python background. Is there a VBA equivilant to Python when it comes to indexing part of a returned function? This is what I mean: If I have VBA code that looks like this:
Split(Worksheets("range").Range("K2").Offset(i, 0), "-", "-1")
And I only want the third part of the split, how would I get just that to output?
I imagine this is a really simple question but I can't seem to think it through. Thanks in advance!
Split(Worksheets("range").Range("K2").Offset(i, 0), "-", "-1")(2)would work with the defaultOption Base 0setting, but as others have noted this might raise an error if there's no theird element in the array.