copy and paste into xp defaults to text data-type

  • Thread starter Thread starter belinda
  • Start date Start date
B

belinda

When I copy and paste data into Excel XP from other
applications (such as Access), I find that the numeric
fields always default to text data types. This is really
irritating!!! I know that I can go in afterwards and
convert them to numbers. However, is there some setting
somewhere that can change the default to number, so that I
don't have to convert them each time?
The data I am pasting into excel is wholely number format
(ie. there is no mixture between numeric and text
datatypes).

Thanks

Belinda
 
Instead of pasting, you can choose Edit>Paste Special, and choose csv or
Text.

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 paste as csv:

'=======================
Sub PasteCSV()
ActiveSheet.PasteSpecial Format:="Csv", _
Link:=False, DisplayAsIcon:=False
End Sub
'========================

Or to convert the numbers:

'=============================
Sub ConvertToNumbers()
'by Jon Peltier
Cells(65535, 255).Copy
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlPasteSpecialOperationAdd
End Sub
'=============================
 
Back
Top