Copy & paste range

N

nc

Can you please help write this macro to achieve the following,

I would like to copy the data from sheet "Bank Statement" to "Transactions".

The macro should check if the cell A2 on the "Transaction" sheet is empty.
If it is just insert 1 in the cell A2 on the "Bank statement" sheet. Then
copy the data from that sheet to A2 on the "Transaction" sheet.

If cell A2 on the "Transaction" sheet is not empty. Look at the maximum
value in column A of the "Transaction", add 1 to this value and insert it in
cell A2 on the "Bank statement" sheet. Then copy the data from that sheet to
the "Transaction" sheet, but this time find the last row being used, and
paste the data in column A, in the row below the last row. In my example
this would be row 6.

I hope it is clear what I am trying to achieve.



Sheet named "Bank Statement"

A B C D
1 Row Date Text Amount
2 02/07/2009 ddd 20
3 =B10+1 02/07/2009 eee 50
4 =B11+1 02/07/2009 fff 29
5 =B12+1 02/07/2009 ggg 30
6 =B13+1 02/07/2009 hhh 33


Sheet named "Transactions"

A B C D E F G
1 Row Date Text Amount ID Name Amount
2 1 01/07/2009 aaa 100
3 2 01/07/2009 bbb 200
4 3 01/07/2009 ccc 300 1000 John 2000
5 1001 Jack 1000
6
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top