Link to home
Start Free TrialLog in
Avatar of AccountantsTech
AccountantsTech

asked on

Excel VBA Number Format

I am having a problem with the number format for cell that is being cleared with VBA and then a raw report from Quickbooks is imported.  

The problem happens when a value with a leading zero is imported as a number.  For example: account number "0123456" is imported as "123456".  

I am stumped with how to force the formatting to be "Text" so that the number shows right.  At first glance this might seam like a simple line to format the data to text before it is placed on the worksheet would fix this but the report is simply being deposited into the sheet without addressing each value.  

Thanks for your help.
ASKER CERTIFIED SOLUTION
Avatar of Michael Fowler
Michael Fowler
Flag of Australia 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
Avatar of AccountantsTech
AccountantsTech

ASKER

I actually just went around this issue by running a post import routine that checks the length of the value and adds a leading zero if it is shorter.  All values should be 6 characters long.

Thank you for you help!