How to create a macro that removes unnecessary digits in zip code?
Hello all! I format lots of files per day and would like to create a macro that automates most of it. I'm aware that using "Text to Columns" with a specific fixed width and then not importing the second half works to remove the extra four digits, but can't figure out how I would go about coding that. The recording process does not work, unfortunately.
For context, I've included an example of what the zips might look like- all zips should end up in a 5 digit format, with leading zeroes if the zip is only 4 digits. The zip codes will always be in the N column, and the left and right columns also have data in them. As you can see, nine digit zip codes may be in 00000-0000 or 000000000 or 00000 0000. I've tried reformatting all zips to be 00000-0000 with the zeroes trailing for 5 digit zips, but I cant seem to use the delimited option in text to columns to get rid of the extra ones either. Any advice appreciated!
[link] [comments]
Want to read more?
Check out the full article on the original site