Text to Numbers

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Text to Numbers

Post by jstevens »

I have approximately 400,000 numbers that are imported into Excel 2007 and are coming in as text. Is there a way to convert the entire range to numeric values in one sweep? I have tried formatting the range as "accounting and number" but that did not work.
untitled.png
Thanks,
John
You do not have the required permissions to view the files attached to this post.
Regards,
John

User avatar
HansV
Administrator
Posts: 78665
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Text to Numbers

Post by HansV »

Select the cells.
Make sure that they are formatted as General or as a number, not as Text.
Press Alt+F11 to activate the Visual Basic Editor.
Press Ctrl+G to activate the Immediate window.
Type

Selection.Value = Selection.Value

and press Enter.

If the values are in one column, an alternative is to select them, then click Text to Columns in the Data tab of the ribbon. Click Finish without changing any settings.
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2631
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Text to Numbers

Post by jstevens »

Hans,

One other thing relative to the 400,000 records.

I am trying to purge 200 different Entities and their account records from the list. I have tried applying an advanced filter on the entire record set (400,000) but it is taking quite a while to process. I know the advanced filter code works as I tested it on a smaller record set.

Your thoughts are appreciated.
John
Regards,
John

User avatar
HansV
Administrator
Posts: 78665
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Text to Numbers

Post by HansV »

Excel is bound to be slow with 400,000 records. Does sorting the records by Entity make it easier?

Another option would be to import the data into a database (Access or SQL Server), manipulate them and then if desired, export them back to Excel (I'd probably keep on using the database instead).
Best wishes,
Hans