Hello Ninjas,
In a Range(A1:A10), user may type landline number (8 digits) or mobile number (9 digits). I need a vba code to change the format of the numbers as mentioned below.
If it is a 8 digit (Landline) number then the format should be "5443 8450"
If it is a 9 digit (Mobile) number then the format should be "0 403 806 605"
Also, if they enter less than 8 or more than 9 digit, we can show an error message
"The value in this cell does not appear to be a full valid phone number. Please enter again."
I tried writing a code using Worksheet_change event, but not successful.
Thanks for your help!
Muru
In a Range(A1:A10), user may type landline number (8 digits) or mobile number (9 digits). I need a vba code to change the format of the numbers as mentioned below.
If it is a 8 digit (Landline) number then the format should be "5443 8450"
If it is a 9 digit (Mobile) number then the format should be "0 403 806 605"
Also, if they enter less than 8 or more than 9 digit, we can show an error message
"The value in this cell does not appear to be a full valid phone number. Please enter again."
I tried writing a code using Worksheet_change event, but not successful.
Thanks for your help!
Muru
Last edited: