View Single Post
 
Old 09-14-2022, 03:55 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Ahh, I see what your problem is. The Split command is not returning a two dimensional array. Have a look at how many 'lines' you have after running the split command.

If you split a string containing carriage returns but don't use those CRs as the split trigger then the result will include those CRs in the middle of the array item. This means that
" ++ 105<CR>0 ++ " splits to become an item in the array which has a value of "105<CR>0"

I think you will find that this line is not doing what you expect it is
Lines = Split(Textline, vbNewLine)

If it was, would you see the value of lines(i) being as large as 20 paragraphs?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia

Last edited by Guessed; 09-14-2022 at 10:10 PM.
Reply With Quote