I've got a few worksheets that each have a lot of cells filled with the beginnings of zip codes and I'm looking for a way to split the cell values to actual zip codes.
The values in cells vary from single zip codes ("03" = 03000) to combinations ("11,215-219,30" = 11000, 21500, 21900, 30000) and I'm trying to come up with a macro that can identify each beginning of a zip code in the cell to an actual zip code (NumberFormat = "00000").
I've tried to come up with some MID(c.value,i,x)-loops but I haven't been able to come up with a solution that can handle the mixed lengths, beginning zeroes etc
The splitting characters are space, comma and hyphen and because they've typed manually there can be more than a single splitting characters in a row ("00 - 01, 03- 035" = 00000, 01000, 03000, 03500).
Any ideas how to do this?
The values in cells vary from single zip codes ("03" = 03000) to combinations ("11,215-219,30" = 11000, 21500, 21900, 30000) and I'm trying to come up with a macro that can identify each beginning of a zip code in the cell to an actual zip code (NumberFormat = "00000").
I've tried to come up with some MID(c.value,i,x)-loops but I haven't been able to come up with a solution that can handle the mixed lengths, beginning zeroes etc
The splitting characters are space, comma and hyphen and because they've typed manually there can be more than a single splitting characters in a row ("00 - 01, 03- 035" = 00000, 01000, 03000, 03500).
Any ideas how to do this?
Last edited: