to split a cell

natedogg

New Member
Joined
Nov 3, 2004
Messages
43
i can split a column of cells right after the 9th digit by using text to columns. which i can insert that code in a macro i need to run. when i choose text to columns, i need my data to remain text, which some numbers start with a zero. those get deleted. then having to reformat the column to text, seems different sources of data are not turning to text when, i dont know but does anyone have an efficient piece of code laying around that will take the digits after the 9th and delete those or placing on next column or something. :unsure:
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try to record one macro for text to columns. Note step 3 of the wizard, you can set any of splitted columns to text. Study the macro, the format exists in the FieldInfo like Array(3, 2) where 2 indicates text format which will not remove 0.
 
Upvote 0
I will look at that, but the data comes in as text, general or something else, then when text to columns is done it seems show (dont know what is is technically called) the equation for that number in some cells. Then I reformat to number and it will turn those into numbers but the cells lose the zero in front. Can not find the perfect combination to get it all to text showing as a number.
I think there should be some better code than the text to column?
 
Upvote 0

Forum statistics

Threads
1,213,526
Messages
6,114,122
Members
448,550
Latest member
CAT RG

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