I
Iain Mac
I have a few columns of data, comparing some financial data. Both sets of
financial data have identifying detail codes, but both years do not have all
the same codes. So what I want to do is check the code on (say) A2 against
E2, and depending on the result carry out a function
A B C D E F G
-----------------------------------------------------------
1 Detail Desc £ Detail Desc £
2 30116 XYZ 1,000 30116 ABC 1,000
3 30140 QAZ 2,000 31000 QWE 2,000
4 32000 PLM 3,000 31500 OKN 3,000
So in this small example I need to macro to do the following:
a) Check A2 to E2. As A = E, this is ok so the macro can move onto the next
row
b) Check A3 to E3. As A < E, then highlight the range A3:C3 and insert a
row to these 3 cells, moving it down
c) Check A4 to E4. As A > E, then highlight the range E4:G4 and insert a
row to these 3 cells, moving it down
Then carry on until the end of the data
I am learning VBA (Using Excel 97), but and not work this out, can anyone
help please?
financial data have identifying detail codes, but both years do not have all
the same codes. So what I want to do is check the code on (say) A2 against
E2, and depending on the result carry out a function
A B C D E F G
-----------------------------------------------------------
1 Detail Desc £ Detail Desc £
2 30116 XYZ 1,000 30116 ABC 1,000
3 30140 QAZ 2,000 31000 QWE 2,000
4 32000 PLM 3,000 31500 OKN 3,000
So in this small example I need to macro to do the following:
a) Check A2 to E2. As A = E, this is ok so the macro can move onto the next
row
b) Check A3 to E3. As A < E, then highlight the range A3:C3 and insert a
row to these 3 cells, moving it down
c) Check A4 to E4. As A > E, then highlight the range E4:G4 and insert a
row to these 3 cells, moving it down
Then carry on until the end of the data
I am learning VBA (Using Excel 97), but and not work this out, can anyone
help please?