Archive of Mr Excel Message Board

Back to Data in Excel archive index
Back to archive home

Copying a column of zip codes and trimming off the first character
Posted by Paul B on February 11, 2002 3:54 PM
Is there a macro solution to copying a column and trimming the first character. I'm trying to create a 4 digit pass code from a list of zip codes.

Did you know that this can be done with Text to Columns...?
Posted by Mark W. on February 11, 2002 4:04 PM
Suppose A1:A2 contains {78501;78704}...
1. Select column A:A
2. Choose the Data | Text to Columns... menu commmand
3. Click the "Fixed width" radio button at Step 1 of 3
and press [ Next> ].
4. Click in the Data preview window to signify
a column break after the 1st character position
and press [ Next> ].
5. Select the 1st column in the Data preview
window and click "Do not import column (Skip)"
radio button.
6. Change the "Destination" to $B$1 and press
[ Finish ].

now that's a neat trick!
Posted by anno on February 11, 2002 5:06 PM

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.