A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
@VuNguyen7
As others suggested protect the sheet with a password - 1234 below - (you should also protect your VBA project...)
in ThisWorkbook
Private Sub Workbook_Open()
'
Call OnWorkbookOpen
End Sub
in Module1
Option Explicit
Private pwd As String
Sub OnWorkbookOpen()
'
pwd = "1234"
End Sub
Sub InsertRow_Click()
'
Dim i As Integer
Dim oList As ListObject
Set oList = ActiveSheet.ListObjects("Invoice")
Application.ScreenUpdating = False
With ActiveSheet
.Unprotect pwd
For i = 1 To 10
oList.ListRows.Add alwaysinsert:=True
Next i
.Protect pwd
End With
Application.ScreenUpdating = True
End Sub