
Originally Posted by
Baza171
Ive got a spreadsheet which im trying to enter information on sheet 1 but want it to record every entry on sheet 2 in a list type form. The trouble im having is that i have to delete sheet 1 with every new entry and it just deletes my info on sheet 2.
Please help any ideas!!!!!
Thanks for reading!!
one possibility,
In sheet1, rightmouse the tab, and View Code
paste this code there.
Private Sub worksheet_change(ByVal Target As Range)
If Target.Column = 1 And Cells(Target.Row, 1).Value = "" Then
Application.EnableEvents = False
Dim iLastRow As Long, sAddress As String, iRowTo As Long
sAddress = Target.Address
Application.Undo
iLastRow = Sheets("Sheet2").Range("A65536").End(xlUp).Row
iRowTo = 0
On Error Resume Next
iRowTo = Application.WorksheetFunction.Find(":", sAddress, 1)
If iRowTo > 0 Then
iRowTo = Application.WorksheetFunction.Find("$", sAddress, iRowTo + 2)
iRowTo = Mid(sAddress, iRowTo, 5)
End If
If iRowTo < Target.Row Or iRowTo > 100 Then
iRowTo = Target.Row
End If
Range("A" & Target.Row & ":A" & iRowTo).EntireRow.Cut Sheets("Sheet2").Range("A" & iLastRow + 1)
Application.CutCopyMode = False
Application.EnableEvents = True
End If
End Sub
when you delete a cell (or row) that row should appear on Sheet2
hth
---amended for multiple rows.
Bookmarks