I have a string with multiple email addresses separated by semicolons and want to split them into separate values.
Dim RecipientArray() As Variant 'I've also tried as string
Debug.Print txtRecipients.Value
RecipientArray = Split(txtRecipients.Value, ";") 'error happens here
For i = 0 To UBound(RecipientArray)
Debug.Print RecipientArray(i)
Next
Make RecipientArray
a plain Variant instead of a Variant array.
'Dim RecipientArray() As Variant 'I've also tried as string
Dim RecipientArray As Variant
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With