Paste from Access

  • Thread starter Thread starter Michael Wulk
  • Start date Start date
M

Michael Wulk

When pasting an Access query results into an Excel
worksheet the numbers are converted to text. The best
work around seems to paste special as CSV. Is there a
better solution?
 
You can continue to paste special as csv, or, do a normal paste, and
then change the data back to numbers:

1. Select an empty cell on the worksheet
2. Choose Edit>Copy
3. Select the cells that you pasted from Access
4. Choose Edit>Paste Special
5. Select Add, click OK

If you do this frequently, you can use a macro to paste as csv:
'=======================
Sub PasteCSV()
ActiveSheet.PasteSpecial Format:="Csv", _
Link:=False, DisplayAsIcon:=False
End Sub
'========================

Or to convert the numbers:
'=============================
Sub ConvertToNumbers()
'adapted from code by Jon Peltier
Cells(65535, 255).Copy
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlPasteSpecialOperationAdd
Selection.WrapText = False
Selection.EntireColumn.AutoFit
End Sub
'=============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top