Revathi

New Member
Joined
May 26, 2015
Messages
34
Hi,

I have automated a small part for "Text to columns" but recently i have noticed after doing the text to columns it is reflecting in a some other format eg. Correct data - 18110274E9 AFTER AUTOMATED - 1.181E+16.

:confused::confused::confused:
Please can someone help me on this.. if it is required i will share my file to you. The below is the code which i have used for Text to columns..

Thanks.


Sub Sample5()
Worksheets("Test").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A22:A600").Select
Selection.TextToColumns Destination:=Range("A22"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), Array(12, 1), Array(30, 1), Array(51, 1), _
Array(64, 1), Array(77, 1), Array(92, 1), Array(101, 1), Array(122, 1), Array(127, 1), _
Array(132, 1), Array(134, 1), Array(137, 1), Array(145, 1), Array(162, 1), Array(176, 1)) _
, TrailingMinusNumbers:=True
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,351
Office Version
  1. 365
Platform
  1. Windows
Re: Bug in Text to columns. Please help

In the FieldInfo array try using 2 (Text) instead of 1 (General) for the column data type.
 

Revathi

New Member
Joined
May 26, 2015
Messages
34
Re: Bug in Text to columns. Please help

Thanks a lottttttttttttttttttt. you really made my day.. thank you so much
 

Forum statistics

Threads
1,171,710
Messages
5,877,077
Members
433,230
Latest member
Prem3300

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
Top