arrays - Split() in VBA gives Type Mismatch error -


i'm have error in code below, please can me..the vba sad me instrument invalid qualifier on line lenght, when use function len() don't have error, on function split happens!the vba sad me type mismatch.

sub getinstrument()  dim instrument string  dim splitinstrument() string  dim integer  dim removespax integer  dim tam integer  removespax = -1  instrument = range("e3")  splitinstrument() = split(instrument)  tam = instrument.lenght - 1  = 0 tam     if splitinstrument(i) <> ""         removespax = removespax + 1        splitinstrument(removespax) = splitinstrument(i)     end if  next  redim preserve splitinstrument(removespax)  msgbox splitinstrument() end sub 

since want tam loop through array, want this

tam = ubound(splitinstrument) 

instead of

tam = instrument.lenght - 1 

Comments

Popular posts from this blog

c# - Derived UserControl layout resets after build -

sql - Postgresql error: "failed to find conversion function from unknown to text" -

haskell - Using Monad/ST for non-concurrent message passing in a mutable graph -