G
Greegan
I have an address list of companies that come in more times a week from my
customers than I care to work on.
My shipping software doesn't accept 9-digit zip codes for US destinations
and will choke if I don't remove them.
Column H is the Country Code column.
Column I is the Zip/Postal Code column.
Currently I have a macro that I recorded which does the following.
Enters a blank column in Column J (usually contains other data).
Then counts the length of characters in each cell.
Sorts the sheet to Column J in Descending order
That's the macro. I then highlight all cells in Column I with 9 or more
characters (as noted in Column J) from the country code of US (Column H) and
do a Fixed Text to Columns to remove the 4 digits on the right.
I do this again with all cells with 8 and then 7 characters.
I format the column as Zip Code and I am done.
My Problem with this:
The way I did the macro was to highlight the whole of Column J and do a fill
down with the "=len(cell)" formula.
This causes a problem as it now suggests we have 60,000 items in Column J.
Being that there could be 5000 addresses one day and 10,000 the next I
didn't know of any other way to do this.
My Question is...
Would it be possible to do all the above in one macro?
If I'm recording a macro, is there a way to have it select the end of the
column when there is a chance it won't be in the same row each time. Sort of
like Ctrl+End but for the column.
Your help is much appreciated.
G
customers than I care to work on.
My shipping software doesn't accept 9-digit zip codes for US destinations
and will choke if I don't remove them.
Column H is the Country Code column.
Column I is the Zip/Postal Code column.
Currently I have a macro that I recorded which does the following.
Enters a blank column in Column J (usually contains other data).
Then counts the length of characters in each cell.
Sorts the sheet to Column J in Descending order
That's the macro. I then highlight all cells in Column I with 9 or more
characters (as noted in Column J) from the country code of US (Column H) and
do a Fixed Text to Columns to remove the 4 digits on the right.
I do this again with all cells with 8 and then 7 characters.
I format the column as Zip Code and I am done.
My Problem with this:
The way I did the macro was to highlight the whole of Column J and do a fill
down with the "=len(cell)" formula.
This causes a problem as it now suggests we have 60,000 items in Column J.
Being that there could be 5000 addresses one day and 10,000 the next I
didn't know of any other way to do this.
My Question is...
Would it be possible to do all the above in one macro?
If I'm recording a macro, is there a way to have it select the end of the
column when there is a chance it won't be in the same row each time. Sort of
like Ctrl+End but for the column.
Your help is much appreciated.
G