Hi,
I need to check the validity of email addresses (with hyperlink).

I found a nice function and it works, unless the email address has trailing spaces (they are not considered at all).

It seems to me that Excel 2019 automatically eliminates the trailing spaces when passing the email address when in reality the data in the cell is WITH trailing spaces.

Let's say I have this email address in A1: "john at gmail.com " (note the space at the far right).


In the VBA function I pass the A1 value to strEmail

If I check the lenght of the string passed into the function or the lenght of the trimmed string, they're the same.

I also checked in VBA Editor the real time values of variables and the string I pass is already without spaces.

Even removing the hyperlink from the cell doesn't change things.
How can I solve this problem?


Thank you very much for your time.

Matt