Asked By
Abrianna
60 points
N/A
Posted on - 10/08/2012
During error handling in VBA split, what happens if I don’t include error handling in each and every function and sub-routine I write in a code?
Function and sub-routine during error handling in vba split
Hi Abriana,
As per my knowledge, while using a split function you don't really need to use error handling. You can just use the split function and you don't need to error handling in each and every step. Following example will help you:-
Sub mysplit()
Dim a As String 'declare a string
a = "hello" 'assign it a string say 'hello'
b = Split(a, "l") 'split the string on delimeter l
MsgBox b(0) 'show it on Messagebox
Â
End Sub
Â
This code will show word 'he' in MsgBox if you run it in excel macro.
Â
Â
Â
The above two pictures show the code and its result as well. Hope it helps you