Exporting text data to Excel from Access - auto inserted quotes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to export a table of text data to excel from Access.
The transferspreadsheet command works great - except a quote is inserted at
the start of each text field.

how do I get around this?
Thank You,
Jean Murray
 
Hi Jean,

Without the apostrophe, Excel would interpret a string of digits in the
text field as a number rather than as text. That's why it gets inserted.
Normally they don't do any harm: they display in the formula bar but not
in the worksheet.

There's no simple way of exporting to Excel without apostrophes being
added like this. One approach would be to export to a text file
(*without* using quote marks to qualify text fields) and import that to
Excel.

Or you can export in the usual way and then dispose of the apostrophes
in Excel by running a macro like this one, which removes them from the
cells you have selected.

Sub RemoveApostrophes()
Dim C As Excel.Range
For Each C In Application.Selection.Cells
C.Formula = C.Formula
Next
End Sub
 
Back
Top