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?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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
-
How start headers and page numbers on page 3?
by
Davidhs
3 hours, 31 minutes ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
1 hour, 1 minute ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
12 hours, 12 minutes ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
12 hours, 13 minutes ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
1 hour, 55 minutes ago -
Firefox 139
by
Charlie
14 hours, 36 minutes ago -
Who knows what?
by
Will Fastie
7 hours, 19 minutes ago -
My top ten underappreciated features in Office
by
Peter Deegan
12 hours, 57 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
7 hours, 20 minutes ago -
Misbehaving devices
by
Susan Bradley
15 hours, 5 minutes ago -
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
1 day, 18 hours ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
13 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
1 day, 17 hours ago -
Discover the Best AI Tools for Everything
by
Alex5723
16 hours, 40 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
1 day, 7 hours ago -
Rufus is available from the MSFT Store
by
PL1
1 day, 15 hours ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
2 days, 18 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
18 hours, 26 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
17 hours, 9 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
2 days, 14 hours ago -
Office gets current release
by
Susan Bradley
2 days, 17 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
4 days, 7 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
3 days, 15 hours ago -
Stop the OneDrive defaults
by
CWBillow
4 days, 7 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
4 days, 17 hours ago -
X Suspends Encrypted DMs
by
Alex5723
4 days, 20 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
4 days, 20 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
4 days, 20 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
4 days, 21 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
4 days, 9 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
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.