Need to copy a whole sheet into another

Closed
logsmein Posts 1 Registration date Tuesday 5 November 2013 Status Member Last seen 5 November 2013 - 5 Nov 2013 à 04:57
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 5 Nov 2013 à 11:27
Working with 2 sheets, one as the invoice and the second as the master record. Everything entered into the invoice will be automatically copied into the second sheet/ master record. When the invoice is cleared though, the data in the master record still remains.

Kindly help me understand how this can be best done.

1 response

TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 555
5 Nov 2013 à 11:27
Hi Logsmein,

A macro code would be the best solution for you.

Which cells from the invoice sheet needs to go to which column on the master sheet.

Example:
Invoice sheet --> Master sheet
cell B10 --> Column A
cell E15 --> Column B
etc..

Code example would then be:
Sub RunMe()
Sheets("Master").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) = Sheets("Invoice").Range("B10")
Sheets("Master").Range("B" & Rows.Count).End(xlUp).Offset(1, 0) = Sheets("Invoice").Range("E15")
End Sub

Do post back if you get stuck.

Best regards,
Trowa