Need VBA code to Keep adding data from 2 specific cells

Closed
balas182005 Posts 1 Registration date Tuesday November 19, 2013 Status Member Last seen November 19, 2013 - Nov 19, 2013 at 12:49 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Nov 21, 2013 at 10:59 AM
Need VBA code to Keep adding data from 2 specific cells. I have cells C7 & C9 filled with name and address. I have a command button save record. When i click this button it should add the data to 2nd sheet and keep adding the data whenever i change that cell without overwriting the existing one.

Please help
Related:

1 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Nov 21, 2013 at 10:59 AM
Hi Balas,

On sheet2 I put a header in A1 (Name), B1 (Address).
On sheet1 I added a button and named it cmd_Save.
Then attached the following code to the button:
Private Sub cmd_Save_Click()
Range("C7").Copy Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
Range("C9").Copy Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1, 0)
End Sub

Best regards,
Trowa
0