Copy cell value into row

someone21

Board Regular
Joined
Sep 16, 2011
Messages
71
Say a range(a2), i write fruits, so now i want it to be added as well into a row in another sheet(Sheet2)

like...

1. Apple

and then say I change I now put orange into the A2, so now I want another row in the Sheet 2.

like....

2. Orange..... and so on.

Basically a table of whenever typed into A2 will be saved into another sheet.....
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try this: right click Sheet1's tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A2" Then Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
End Sub
 
Upvote 0
Thanks, now what if I have another cell B2 whose value will be copied to the other sheet column B.... and so on for until column H.

How to make that quicker?
 
Upvote 0
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address(False, False)
    Case "A2": Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
    Case "B2": Sheets("Sheet2").Range("B" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
    Case "C2": Sheets("Sheet2").Range("C" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
    Case "D2": Sheets("Sheet2").Range("D" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
    Case "E2": Sheets("Sheet2").Range("E" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
    Case "F2": Sheets("Sheet2").Range("F" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
    Case "G2": Sheets("Sheet2").Range("G" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
    Case "H2": Sheets("Sheet2").Range("H" & Rows.Count).End(xlUp).Offset(1).Value = Target.Value
End Select
End Sub
 
Upvote 0
Does not work for me, and I want this procedure to start whenever I click the button (which is located on the sheet where the A2 is)
 
Upvote 0
Thanks, but for some reason not working, probably some basic reasons, so the code should be within the sheet not module, which is what I did, I add some names into the cell, yet no output in the other sheet row.

And secondly, what if I want it to be a button(marco) to trigger this.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top