excel - Using a split function in a Loop not working -


i receiving no output following code:

sub spliter()  dim text string dim integer dim name variant  until isempty(activecell)      text = activecell.value      name = split(text, " ")              = 0 ubound(name)              cells(1, + 1).value = name(a)                next     activecell.offset(1, 0).select loop end sub 

using 'run to' debugger, can see loops working fine. build splitter sub, loop function shelled it. splitter sub works fine 1 cell , itself, incorporated loop, splitter function delivers nothing. think may array in array issue.

i'm not sure you're trying put data - data activecell may anywhere on sheet , paste on row 1 of same sheet.

this code take activecell , cells below , split text string space , place each word next original sentence.

sub splitter()  dim stext string dim x integer dim vname variant  until isempty(activecell)     stext = activecell.value     vname = split(stext, " ")     activecell.offset(, 1).resize(, ubound(vname) + 1) = vname     activecell.offset(1, 0).select loop  end sub 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -