Fred Wayne
Member
Hello, I am making a User Login/Logout workbook. I want that "Sheet1" to have the capacity to enter data but not be able to delete rows or columns. Is there a code to do this? I am using a VBA Code to set the Login and Logout time. But if I protect the sheet, the Login/Logout code does not work. How can I make that the sheet records the information but block it to avoid the data being deleted?
Thank you in advance.
I am sending the file I just started.
Code:
Private Sub Workbook_Open()
Dim uFila As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
uFila = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
ws.Cells(uFila, 1) = "Login"
ws.Cells(uFila, 2) = Application.UserName
ws.Cells(uFila, 3) = Date & " " & Time
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select
End Sub
Thank you in advance.
I am sending the file I just started.
Attachments
Last edited by a moderator: