Link to home
Start Free TrialLog in
Avatar of AlexPonnath
AlexPonnathFlag for United States of America

asked on

How can i specify a Format in a Excel Column

I have a function in VB 6 which opens Microsoft Excel and exports the data of
a Query into the worksheet. All works fine but the problem is that i have a field
which i populate with some credit card nbrs and the shhet displays them as a
5.47464E+15 instead of 5474643171576970

so my question, how can i set the format of a specific cell as well as how can i set this
for a specific column


SOLUTION
Avatar of RogueSolutions
RogueSolutions

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 RogueSolutions
RogueSolutions


Sorry, to answer your question, it's not really a formatting issue.  The 'number' has no useful meaning, better to handle it as a string.

The apostrophe doesn't show in Excel by the way.
ASKER CERTIFIED 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

Actually, following on from Eddy's comment, I think you'd be better to go with ...

Application.Columns("B:B").NumberFormat = "0000000000000000"

A Credit Card number is always 16 digits (at least here in the UK) so you wouldn't want to lose any proceeding zeros, although I doubt any numbers start like that (at the moment!)