macro to edit cell contents

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
I'm working with a large spreadsheet that has a column of cell entries that are each 14 digits long. I need to edit each cell entry in the column to eliminate the first 3 digits and last 6 digits. For example cell A2 = 00012345000R01, A3 = 00012345000R02. I need to edit the cell to return the five digits 12345. Any ideas on a macro I can write to do this for 50,000 lines of data?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Juan Pablo González

MrExcel MVP
Joined
Feb 8, 2002
Messages
11,959
Use Data | Text To Columns, with "Fixed With". You can make the 3 groups (1-3, 4-8,9-14), and "skip" the first and third columns.

You could also use a formula in an adjacent column, and then copy and paste as values.
 

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
Thank you very much. That was too easy! I was making it much harder than it needed to be. Excel has so many tools, and I'm only scratching the surface. Thanks again.
 

Forum statistics

Threads
1,144,272
Messages
5,723,433
Members
422,497
Latest member
dougy99

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