Simple Excel Macro Solution - Offering a Trade


Posted by Paul B on February 11, 2002 3:45 PM

I am willing to trade a macro that opens "outlook" reads through specific e-mails and pulls information into an excel spreadsheet (excellent for recurring website submissions that need to be tracked or entered into a spreadsheet), for a simple macro that will copy a column within a spreadsheet and strip off the first character of the new column.

I've got a large spreadsheet of addresses and I want to take the zip code and copy it into a new column and strip off the first digit to make it into a 4 digit code.



Posted by Larry Kramer on February 11, 2002 8:46 PM

You don't need a macro. This formula strips the first digit from a five digit code, including one with leading zeros. So instead of a macro, just enter this formula in the target column.

=IF(ZIP-INT(ZIP/10000)*10000<1000,"0"&ZIP-INT(ZIP/10000)*10000,ZIP-INT(SourceCell/10000)*10000)