ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,596
- Office Version
- 2007
- Platform
- Windows
@NoSparks
User shown above made this code for UK post codes & works great.
Post code format was EX26 9HH 4 characters then a space then 3 characters
Also BS9 4DP 3 characters then a space the 3 characters
I would like to use the same code now but for UK Telephone number.
The format for the numbers are like so.
07894 827418 "So 5 digits a space then 6 digits"
The postcode vba does work but it was allowing 2 different post codes & assume something must be removed
Thanks
Existing code.
User shown above made this code for UK post codes & works great.
Post code format was EX26 9HH 4 characters then a space then 3 characters
Also BS9 4DP 3 characters then a space the 3 characters
I would like to use the same code now but for UK Telephone number.
The format for the numbers are like so.
07894 827418 "So 5 digits a space then 6 digits"
The postcode vba does work but it was allowing 2 different post codes & assume something must be removed
Thanks
Existing code.
VBA Code:
Private Sub TextBox2_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Len(Me.TextBox2) > 0 Then
Me.TextBox2.Value = Format(Replace(Me.TextBox2.Value, " ", ""), "@@@@@ @@@@@@")
End If
End Sub