I noticed that since we upgraded at work, many times when I paste numbers from access into excel, excel doesn’t read them as numbers. I have to open the dialog to tell excel to convert them to numbers. Old versions of Excel were smart enough to know that a number is a number. How can I get it to accept numbers properly in this version?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Problem w/ importing numbers (2002)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Problem w/ importing numbers (2002)
- This topic has 18 replies, 8 voices, and was last updated 23 years, 3 months ago.
AuthorTopicWScatzbelize
AskWoody LoungerFebruary 7, 2002 at 8:06 pm #366594Viewing 1 reply threadAuthorReplies-
WSJohnBF
AskWoody Lounger -
WScatzbelize
AskWoody LoungerFebruary 7, 2002 at 9:18 pm #569000I tried changing the format to number, but for some reason, when the data is pasted from Access it changes the format to text. It works fine if I do a paste special and paste values only, but that’s an extra mouse click or two. I used to be able to paste numbers from access without excel changing the format to text.
I attached a file that shows the numbers as they come straight from access. -
WSFrancois
AskWoody Lounger -
WSJohnBF
AskWoody LoungerFebruary 7, 2002 at 11:10 pm #569026Those cells have been pasted as text. On any date or number, press F2 (edit mode), then press enter and the cell contents will be converted to numeric. To further confuse me, Excel 97 will not enter the format menu on any of those cells, and I can’t see why.
Have you installed the Paste Values button on your toolbar? It avoids that annoying menu click-through for Paste Special values. Go into View, Toolbars, Customize, Commands tab to install the button.
There was an extensive thread about this problem some months back, and based on work from a number of other Loungers and a similar problem I have with a Crystal Reports import, I plagiarized the macro below:
Sub Text2Values()
Application.ScreenUpdating = False
Dim rngNumberCells As Range
Dim rng1stCol As Range
Dim rngCell As Range
With Selection
.NumberFormat = “General”
.Replace What:=” “, Replacement:=””, LookAt:=xlPart, SearchOrder:=xlByColumns
End With
On Error Resume Next ‘errors if no numbers in selection
Set rngNumberCells = _
Selection.SpecialCells(xlCellTypeConstants, xlNumbers)
If Not Err Then
For Each rngCell In rngNumberCells
rngCell.Value = rngCell.Value
Next rngCell
End If
Err.Clear
‘ There is a bug in Selection.SpecialCells(xlCellTypeConstants, xlNumbers)
‘ where the first column is skipped
Set rng1stCol = Selection.Columns(1).Address
On Error Resume Next
Set rngNumberCells = _
rng1stCol.SpecialCells(xlCellTypeConstants, xlNumbers)
If Not Err Then
For Each rngCell In rngNumberCells
rngCell.Value = rngCell.Value
Next rngCell
End If
ActiveCell.Select
Application.ScreenUpdating = True
End Sub -
WScatzbelize
AskWoody LoungerFebruary 8, 2002 at 12:21 am #569034Francois, yes the CPProfile is a number in access
Servando, thanks but thats way more work than other solutions
John, yes I have paste values on the toolbar. I wouldn’t dream of running excel w/o that little icon on the toolbar. Now, call me an idiot, but just what am I supposed to do with that bit of code? I’ve used excel for years and years but never used a macro. Now I feel stupid.
-
WSBat17
AskWoody Lounger -
WSJohnBF
AskWoody LoungerFebruary 9, 2002 at 10:39 pm #569357No reason to berate yourself, it’s time you learned to create macros (and user defined functions), it’s not too hard. Legare neatly lays out instructions for setting up a macro in personal.xls in ">this, ">this thread all have some thoughts on places to start. Feel free to ask questions on the Lounge, that’s why it exists.
-
WScatzbelize
AskWoody LoungerFebruary 12, 2002 at 8:02 pm #569997Thanks for not giving up on me John. And thanks for those links. It looks like I have lots to learn.
I have questions on the code you posted above.
How/where would I enter it?
Will it solve the problem permanently to prevent excel from storing the numbers as text?I’m still checking out the other links, but I have a question on the first one.
Legare’s thread starts by saying:
If you already have a Personal.xls, then do the following to add a macro to it:I don’t have a personal.xls and he doesn’t say what to do if you don’t have that file already.
-
WSunkamunka
AskWoody Lounger -
H. Legare Coleman
AskWoody Plus -
WScatzbelize
AskWoody LoungerFebruary 13, 2002 at 1:03 am #570037 -
WScatzbelize
AskWoody LoungerFebruary 13, 2002 at 4:39 pm #570112OK, I now have a personal.xls file. It was extremely simple using Legare’s last post. I tried putting John’s plagerized code from above, but nothing happened to the cells when I executed the macro. I think I did it correctly, so I don’t know why it didn’t work.
By far, the easiest solution to my problem is to use Paste Values. Period.
I downloaded docs from the vbatutor site in one of the posts referenced from John and had fun playing around with VBA code last night. I had no idea how much fun it is. It brings back memories of programming Pascal back in college.
I also tried adding Legare’s Public Function GetFilename in the personal.xls macro workbk using the following code:
Public Function GetFilename(iType As Integer) As String
Select Case iType
Case 1
GetFilename = Trim(Left(ActiveWorkbook.Name, _
InStr(ActiveWorkbook.Name, “.”) – 1))
Case 2
GetFilename = ActiveWorkbook.Name
Case 3
GetFilename = ActiveWorkbook.FullName
Case 4
GetFilename = Trim(Left(ActiveWorkbook.FullName, _
InStr(ActiveWorkbook.FullName, “.”) – 1))
End Select
End FunctionBut when I tried to use it, I just get #NAME? in the cell where I type the formula:
=getfilename(1)
Am I doing something wrong?However, the formula:
=MID(CELL(“Filename”),FIND(“[“,CELL(“Filename”))+1,FIND(“.”,CELL(“Filename”))-FIND(“[“,CELL(“Filename”))-1)
works fine and looks like it could be handy, but I’d rather get the GetFilename function to work. -
WSJohnBF
AskWoody LoungerFebruary 13, 2002 at 5:25 pm #570132The macro I posted was waaaay too specific to the data I have problems with. This simpler version should work. See also the attachment.
Sub Txt2Val()
Application.ScreenUpdating = False
Dim rngCell As Range
With Selection
.NumberFormat = “General”
End With
For Each rngCell In Selection
rngCell.Value = rngCell.Value
Next rngCell
ActiveCell.Select
Application.ScreenUpdating = True
End Sub -
H. Legare Coleman
AskWoody Plus -
WSJohnBF
AskWoody LoungerFebruary 13, 2002 at 5:26 pm #570117While we are trying to drag you into VBA land, it occurs to me that there may be a better way to solve your problem. I’m no Access guru, but I have written a number of Access queries, and I use those to export data from Access to Excel File format for further analysis. So you may want to look at writing a query and exporting from Access to Excel, rather than cut-&-paste. After you design the query in Access, you can export by either (Office 97 menus, your mileage may vary):
1. Clicking the Access Toolbar Drop-Down Item which includes the options of
– Merge it with MSWord
– Publish it with MSWord
– Analyse it with MSExcel
… and select appropriate options, but for unknown reasons that process runs very slowly on my machine, so I usually:2. Right click the specific Query Icon, select Save As/Export, To External Database, Save As File Type Excel, etc.
Once you get this up and running it’s very quick.
-
WSJohnBF
AskWoody LoungerFebruary 12, 2002 at 10:14 pm #570009Hi again, and I assume you have read Unkamaunka’s post, which is helpful except the referenced thread is pretty specific to XL97. You are using XL2002, and I don’t know where 2002 normally keeps it’s .xlstart directory, there’s a further discussion in this thread.
But before you do so, and pardon me if you already know this, many folks run with personal.xls hidden and don’t know that it already exists. So check Window, Unhide to be sure you don’t have one. Then look for an .XLStart directory. If you have two, let’s guess that the latest one is appropriate, and use the information in the above referenced threads to creat a personal.xls.
Also, note that the code will not automatically fix your problem. You’ll have to run it –each time– after selecting the cells which are not converting from text.
Tell us what you find.
-
-
WSWebGenii
AskWoody Lounger
-
-
-
-
WSServando
AskWoody LoungerFebruary 7, 2002 at 10:31 pm #569017I know this is not the ideal solution, but, you can correct your data quickly if you make the following thing:
In an empty cell you can put the number “1”.
Copy this cell.
Highlight all your range of data, and make a Special Paste, selecting “multiply “.
This procedure, will solve your problem
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Does windows update component store “self heal”?
by
Mike Cross
12 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
1 hour, 13 minutes ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
38 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
1 hour, 19 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
3 hours, 54 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
3 hours, 56 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
10 hours, 57 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
12 hours, 3 minutes ago -
0Patch, where to begin
by
cassel23
6 hours, 5 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
1 day, 1 hour ago -
89 million Steam account details just got leaked,
by
Alex5723
13 hours, 27 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
1 day, 10 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 day, 1 hour ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
12 hours, 20 minutes ago -
Installer program can’t read my registry
by
Peobody
7 hours, 18 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
23 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 6 hours ago -
False error message from eMClient
by
WSSebastian42
1 day, 21 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 days, 6 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
2 days, 7 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
1 day, 4 hours ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
2 days, 11 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
1 day, 12 hours ago -
Outdated Laptop
by
jdamkeene
2 days, 16 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
2 days, 22 hours ago -
Another big Microsoft layoff
by
Charlie
2 days, 21 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
19 hours, 4 minutes ago -
May 2025 updates are out
by
Susan Bradley
1 hour, 31 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
3 days, 3 hours ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
3 days, 3 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.