I have around 180 records that have an 80 character string where one row (H1 *) contains an account number the next row (R12*) that contains detail that needs to be separated into different columns on another worksheet. I can use a MID function to extract but I think it would be more efficient to use VBA extract needed data. Below is the criteria:
All in need from the "H1 *" rows are the 4th through 15th characters - this is the account number. For this I used the
=MID(A2,4,15) .
Below that I use the following "MID" statements for the "R12" row:
=MID($A$3,4,13), =MID(A3,14,3), =MID(A3,17,6), =MID(A3,23,10), =MID(A3,33,6), =MID(A3,39,32)
Below are sample records:
H1 000002144581416R12050416050416050416
R1200000101660570419160000034947050416Red Summit Energy
R1200000101860570426160000001260050416Marial Delgado
R1200000101880570426160000000840050416Roberto Garcia
H1 000002798929366R12050416050416050416
H1 000002798965394R12050416050416050416
R1200000015360570419160000134458050416Men Unlimited
H1 000002799001298R12050416050416050416
R1200000018440570421160000001638050416Francis Garcia
R1200000018510570425160000092298050416FarAway Communications
All in need from the "H1 *" rows are the 4th through 15th characters - this is the account number. For this I used the
=MID(A2,4,15) .
Below that I use the following "MID" statements for the "R12" row:
=MID($A$3,4,13), =MID(A3,14,3), =MID(A3,17,6), =MID(A3,23,10), =MID(A3,33,6), =MID(A3,39,32)
Below are sample records:
H1 000002144581416R12050416050416050416
R1200000101660570419160000034947050416Red Summit Energy
R1200000101860570426160000001260050416Marial Delgado
R1200000101880570426160000000840050416Roberto Garcia
H1 000002798929366R12050416050416050416
H1 000002798965394R12050416050416050416
R1200000015360570419160000134458050416Men Unlimited
H1 000002799001298R12050416050416050416
R1200000018440570421160000001638050416Francis Garcia
R1200000018510570425160000092298050416FarAway Communications