Link to home
Start Free TrialLog in
Avatar of nightshadz
nightshadzFlag for United States of America

asked on

Excel - VBA text formatting

I'm trying to format the text of a TextBox into SSN format ###-##-####.  My code looks like this .Text = Format(.Text, "###-##-####").

It works everytime until the leading character is a zero.  If I enter 012345678 it will drop the leading zero.  How do I prevent this?
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nightshadz

ASKER

Thanks for the help guys.  This worked!