Text to Columns - Delimited with a really weird issue with scientific notation after running

jlax2485

New Member
Joined
Mar 24, 2017
Messages
6
Hi,

I am running into a strange problem and I haven't been able to find a suitable solution to it. I have a macro which I am running a text-to-columns on a column filled names and ID's sandwiched together like this:

465E10^JONES, JOHN.

The text to columns work fine with the consistent ^ delimiter, but the problem with this specific instance, is that once the above string is split, excel treats it as scientific notation, and the cell value immediately turns into the number 4650000000000.

I have tried different things to work around this...basically everything in my application depends on this ID number, and if it does not format correctly then my subs will not work.

Is there anything I could do to work around this issue in VBA? This is the first instance of this happening out of hundreds of ID's, but I am sure it will come up again.

Thanks for your help.

Josh
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
On step 3 of the text to columns wizard, select the column you're interested in & then select text, rather than general
 
Upvote 0
I am running into a strange problem and I haven't been able to find a suitable solution to it. I have a macro which I am running a text-to-columns on a column filled names and ID's sandwiched together like this:

465E10^JONES, JOHN.

The text to columns work fine with the consistent ^ delimiter, but the problem with this specific instance, is that once the above string is split, excel treats it as scientific notation, and the cell value immediately turns into the number 4650000000000.
Try adding this to the end of your TextToColumns method call in your macro...

FieldInfo:=Array(Array(1, 2), Array(2, 2))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top