Chris
There is no Custom Format for Canadian Postal codes that I have found.
You can use event code in the worksheet so that as you enter the code, it will
change to A1A 1A1
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column <> 1 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
With Target
.Formula = UCase(Target.Formula)
.Value = (Left(Target.Value, 3) & " " & Right(Target.Value, 3))
End With
ErrHandler:
Application.EnableEvents = True
End Sub
As written this event code operates on Column A only.
You can type the code in as upper or lower case. Will come out as upper case no
matter what.
Right-click on the sheet tab and "View Code"
Copy/paste the above into that sheet module.
Adjust for your column if needed.
i.e. for just column B edit to If Target.Column <> 2 Then Exit Sub
Gord Dibben MS Excel MVP..................and Canuck
Hello,
I would like to set up an input mask in Excel for a Canadian Postal code
(e.g. T7G 8R4). I am not sure how to do this.
Gord Dibben MS Excel MVP