Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Leading Zero drops off report when exported to Excel

Status
Not open for further replies.

MemphisVBA

Technical User
May 31, 2006
23
US
I have a report that is generated in Access and is exported to Excel as an xls file. My problem is that while in access, my leading zeros are fine, but when I export it to Excel, they are dropped. I have tried several things:
I tried to force a format "0000" which works fine in Access but not Excel.
I tried to add an "'" to the front to (I thought) make it text in Excel - that kinda works, but then every record has a (visible) "'" in front of it, which isn't going to fly either.

If I select the column in Excel and change the cell format to a custom "0000" that works, but I am not going to be the one running this report, and I doubt the user will do that.

I tried everything from setting the format in the table to the report - and as stated above, works fine in Access, but not Excel.

Any Ideas?
 
there's no easy way to set the formatting on the resultant excel document...

maybe it would be easier to give your users an excel template from which they can extract the records from, and have the formatting set on the template...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top