Option Explicit
Public r As Integer
Public s As Integer
Public d As Currency
Public z As Integer
Public y As Integer
Public sheetcount As Integer
Public i As Integer
Public e As Integer
Public b As Integer
Public c As Integer
Private Sub CommandButton2_Click()
'Check extent of data
Dim Lastrow As Long
Lastrow = Cells.Find(What:="*", _
After:=[IV24022], SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
If Lastrow + 9 >= 24022 Then
MsgBox ("Rows will exceed 24022!")
Exit Sub
Else
'Insert 10 rows
Dim myRange As Range
Dim AnsRange1 As Integer
Dim AnsRange As Range
Set myRange = Application.InputBox(Prompt:="Select row to insert 10 rows below", Type:=8)
AnsRange1 = myRange.Row
Range(AnsRange1 & ":" & AnsRange1 + 9).Insert Shift:=xlDown
End If
End Sub
Private Sub Worksheet_Activate()
'Worksheets("Input Form").Unprotect
Call cell_locked
'Call Recalc
Call add_validation
Call add_borderline
Call disable_command
'Call delete_validation
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=False
Application.CommandBars("Ply").Enabled = True
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Call disable_command
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveSheet.Name = "Input Form" Then
Else
MsgBox "You are not allow to modify the name of this sheet!", vbCritical, "Not Allow"
ActiveSheet.Name = "Input Form"
End If
End Sub