Export to Excel changes format from number to text

LB79

Registered User.
Local time
Today, 00:11
Joined
Oct 26, 2007
Messages
505
Hi all,

Ive tried searching for an answer to this but it seems there isnt on (that I can find).
I have some code that exports data from Access to Excel. The data in Access is numer formatted.
hen Excel opens, the data has changed to text which the pivot tables wont show (unlss I use text to columns).

How can I forc the data to remain as number format when I export?

Thanks
 
I've copied and pasted a couple of examples from on of my vba codes.
I don't have one specifically for "Numbers" but hopefully this will lead you in the right direction of how to format a text box.

Me.TxtWorkFinished1.Text = Format("0" & Me.TxtWorkFinished1.Text, "hh:mm")
Me.txtTotalLabor3.Text = Format(CCur("0" & Me.txtTotalLabor3.Text), "$#,##0.00")
 
Thanks - Ill have a look through
 
I dont think this resolves the issue.
The table in Access is number format. I use CurrentDb.OpenRecordset to copy the data from Access to Excel. When I use the data in Excel I have to use Text To Columns to be able to use the data in pivot tables etc.
 
Problem solved!
The query was formatting the numbers to #,### which has caused the data to be text in Excel.
 

Users who are viewing this thread

Back
Top Bottom