Copies and saved in a different column

[Closed]
Report
-
Posts
2807
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 21, 2021
-
Hello,

can you guys help me with this.
I want to input a data in cell A1, then it automatically copied into cell B1.
then if I input again another data in cell A1, it will automatically copied to cell B2.
then repeating the process until I reach the last cell in column B.

please...

1 reply

Posts
2807
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 21, 2021
482
Hi Emtee,

You can use the code below by right-clicking on your sheets tab and selecting View Code. Then paste the code in the big white field that appears in a new window.

The following code will do as requested:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
If Range("B1") <> vbNullString And Range("B2") <> vbNullString And _
Range("B1").End(xlDown).Row = Rows.Count Then Exit Sub
If Range("B1").Value = vbNullString Then
    Range("B1").Value = Target.Value
Else
    Range("B" & Rows.Count).End(xlUp).Offset(1, 0).Value = Target.Value
End If
End Sub


Best regards,
Trowa