officedev - Adding vbnewline into strings VBA -


ok when able solve (with stackoverflow assistance) arranging entries time function, presented new issue.

it no longer followed rules of template have attached it. not huge problem because thought of quick solution not working.

i have added function below, purpose:

  1. split string passed -thesentence- array -thewords()-

  2. find out if string -final- (do while loop adds each word array string 1 @ time) if more 56 length

  3. if -final- more 56 length add vbnewline string before adding next word

  4. change original string -thesentnce- equal created string -final- should have vbnewline in after approx 56 length

.... not working need push in right direction stupid

  function chcklen(byval thesentence string)    dim thewords() string dim final string dim arraycntr integer dim arrayamount integer dim chcker integer    arraycntr = 0     thewords = split(thesentence)   arrayamount = ubound(thewords)   chcker = 56    while arraycntr <= arrayamount     if len(final + thewords(arraycntr)) > chcker      final = final + vbnewline       final = final + thewords(arraycntr)      chcker = chcker + 56    else      final = final + " " + thewords(arraycntr)    end if          arraycntr = arraycntr + 1   loop    thesentence = final  end function 


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -