View Single Post
 
Old 07-21-2016, 03:59 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
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

Austin

You are getting duplicates because of the string you are using as the input. You are selecting the text in Word and including the paragraph mark (which in this case is preceded by the number 61). Then the paragraph mark is included in all the processing so that you eliminate all excess '61's and also have a '61return'. It should be easy to remove this in your code early by including a replace line to remove Chr(13)
Code:
OGList = Selection.Text
OGList = Replace(OGList, " ", "")
OGList = Replace(OGList, Chr(13), "")
SplitList = Split(OGList, ",")
Greg's code anticipated your starting selection could include a paragraph mark and he solved that issue in his function fcnKillWhiteSpace - personally I think he should have named it KillFcnWhiteSpace .
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia

Last edited by Guessed; 07-21-2016 at 04:08 PM. Reason: Looked at Greg's code
Reply With Quote