MrExcel Publishing
Your One Stop for Excel Tips & Solutions

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.

Posted by Mark W. on February 11, 2002 4:04 PM

Did you know that this can be done with Text to Columns...?

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 ].

Posted by anno on February 11, 2002 5:06 PM

now that's a neat trick!