#1   Report Post  
Posted to microsoft.public.excel.misc
nc nc is offline
external usenet poster
 
Posts: 119
Default Copy & paste range

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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy range and paste as picture jlclyde Excel Discussion (Misc queries) 2 April 28th 08 09:52 PM
Copy, Paste and Rename a Range using a macro [email protected] Excel Discussion (Misc queries) 1 April 15th 08 03:58 PM
VBA Code- Copy & Paste in Blank Range Youlan Excel Discussion (Misc queries) 9 March 27th 08 03:22 PM
copy range and paste into every 3rd cell of new range thomsonpa New Users to Excel 4 December 3rd 07 01:47 PM
CheckBox Code to copy & paste range Casey Excel Discussion (Misc queries) 0 October 13th 05 05:32 PM


All times are GMT +1. The time now is 03:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"