lundi 20 avril 2015

Split function isn't recognising white space from text copied from internet page source

I've set up a function to process data copied and special pasted (value only) onto my worksheet.
The data in question is a name "John A Smith"

And my method is

Dim vFullName As Variant
Let vFullName = Split(sName, " ")

When I split the pasted string, I only get 2 arrays; [0] John & [1] A Smith
If I enter the data myself I get the expected 3 arrays; [0] John, [1] A & [2] Smith

I can't understand why the pasted string isn't splitting completely. Can anyone tell me why the second space isn't being registered.
The Spaces are physically there.

Cheers

Aucun commentaire:

Enregistrer un commentaire