Export to Excel changes format from number to text (1 Viewer)

LB79

Registered User.
Local time
Today, 00:53
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
 

cjohnson78

Registered User.
Local time
, 16:53
Joined
Mar 29, 2012
Messages
11
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")
 

LB79

Registered User.
Local time
Today, 00:53
Joined
Oct 26, 2007
Messages
505
Thanks - Ill have a look through
 

LB79

Registered User.
Local time
Today, 00:53
Joined
Oct 26, 2007
Messages
505
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.
 

LB79

Registered User.
Local time
Today, 00:53
Joined
Oct 26, 2007
Messages
505
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

Top Bottom