(Trim may be redundant, but belts and braces…) Which will eliminate the spaces, trim off any extra spaces at the front and back and convert to upper case. If you wish to add these back every 4 characters, this is easy to do – or simpler still, replace the first line of the code above with: IBAN = Trim(Ucase(Replace(IBAN, " ", ""))) Note: I removed the provision of spaces ( ) as the text I am testing has none. If you wish to add your own countries, extend the above. I hope this helps someone else, as the initial code helped me. Set objRegExp = CreateObject("vbscript.regexp") ![]() ![]() Public Function VALIDATEIBAN(ByVal IBAN As string) As Boolean
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |