Working on a new project and thinking about the best way to achieve something.
I have a range of cell that each contain a string of names delimited by semi-colons such as "Last, First;Last2, First2;Last3, First3". In the end, I want each name String to be added to an array (I will dedupe the array once all values have been added).
I have used the split function before and I think perhaps I could use the copy array function to add them to the destination array? So, it would look something like:
Assuming this works, is there an easier ("cleaner") way to achieve this?
I have a range of cell that each contain a string of names delimited by semi-colons such as "Last, First;Last2, First2;Last3, First3". In the end, I want each name String to be added to an array (I will dedupe the array once all values have been added).
I have used the split function before and I think perhaps I could use the copy array function to add them to the destination array? So, it would look something like:
Code:
Dim nameString As String
Dim tempArray() As String
For i = 2 to LastRowOfRange
nameString = CSTR(Range("A"& i).Value)
tempArray = SPLIT(nameString,";")
P[COLOR=#003366]ublic Function CopyArray(DestinationArray As Variant, tempArray As Variant, _
Optional NoCompatabilityCheck As Boolean = False) As Boolean[/COLOR]
Next i
End Sub
Assuming this works, is there an easier ("cleaner") way to achieve this?