In excel, I want the numbers to be formatted in the column.
If we enter any other number then I want the number to have dash (-) after the fourth letter. For eg. if we enter 12345678 then I want it to convert to 1234-5678.
Thanks!
Use the escape character \
e.g. number format 0000\-0000
Enter the string above into a 'Custom' number format
from : http://msdn.microsoft.com/en-us/library/0c899ak8(v=vs.110).aspx
To do it with VBA:
Sub fmt()
Range("A1").NumberFormat = "0000\-0000"
End Sub