Bellaanima7
New Member
- Joined
- Jul 23, 2020
- Messages
- 22
- Office Version
- 365
- Platform
- Windows
Hi All, I am trying to create a code that will automatically move the data after I start making changes from sheet "Mitch" and column "O" to another sheet that is named "Mitch Archive" in the same column "O". It would leave me with new data in sheet "Mitch" and previous data would be in "Mitch Archive". I also want it to add it to the same column and not override it. I do not want to delete previous archived data or add it in the row below. I want it all in the same cell ie. O2 - Can anyone help me please?
That's my code that is all messed up:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Comments As String
Sheets("Mitch").Select
Comments = Range("O2")
Sheets("Mitch Archive").Select
Sheets("Mitch Archive").Range("O2").Select
If Sheets("Mitch Archive").Range("O2").Offset(1, 0) <> "" Then
a = Sheets("Mitch Archive").Cells(Rows.Count, "O").End(xlUp).Row + 1
Sheets("Mitch Archive").Range("O" & a).Value = Sheets("Mitch").Range("O2").Value
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = Comments
Sheets("Mitch").Select
Sheets("Mitch").Range("O2").ClearContent
End Sub
That's my code that is all messed up:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Comments As String
Sheets("Mitch").Select
Comments = Range("O2")
Sheets("Mitch Archive").Select
Sheets("Mitch Archive").Range("O2").Select
If Sheets("Mitch Archive").Range("O2").Offset(1, 0) <> "" Then
a = Sheets("Mitch Archive").Cells(Rows.Count, "O").End(xlUp).Row + 1
Sheets("Mitch Archive").Range("O" & a).Value = Sheets("Mitch").Range("O2").Value
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = Comments
Sheets("Mitch").Select
Sheets("Mitch").Range("O2").ClearContent
End Sub