I have number and letter combinations that create one field, some with dashes, some without and with varied lengths. I need to parse sections before, between, and after the dashes from an Excel import. Ex. one is of the pattern X-XXXX-XX or XX-XXXXX-X, another is XXXXXX, and another is XXXXXX-XXX.
I tried a substring function : left([part],2) but this only works for a few of the parts since the lengths vary. I'm looking for a macro that would separate with "if" loops for the different kinds. There is a small, finite number (say 6 or so).
Any suggestions? The only other way to do it is reconstruct the database so the whole is one field instead of four; but it's not the best solution as the middle (or base) is a number to search.
Thank you.
I tried a substring function : left([part],2) but this only works for a few of the parts since the lengths vary. I'm looking for a macro that would separate with "if" loops for the different kinds. There is a small, finite number (say 6 or so).
Any suggestions? The only other way to do it is reconstruct the database so the whole is one field instead of four; but it's not the best solution as the middle (or base) is a number to search.
Thank you.
Last edited: