I have the code below to insert lines on a sheet.
It works correctly and inserts the lines BUT then the lines get hidden.
I can't understand what is causing this. There is no event code in the worksheet module.
DK.
Sub InsertSch1NotesLine()
Dim myRow As Long
Application.ScreenUpdating = False
'Application.Calculation = xlCalculationManual
myRow = ActiveCell.Row
If Cells(myRow, "E").Value <> 1 Then
MsgBox "Can't insert an Notes Line here", vbOKOnly, "Invalid Line"
Exit Sub
Else
myInput = InputBox("How many lines do you want to insert?", "# of Lines", 1)
'Rows("95:100").EntireRow.Hidden = False
Range("InsertSch1NotesLine").EntireRow.Copy
myInput = myInput * Range("InsertSch1NotesLine").Rows.Count
ActiveCell.Resize(myInput, 1).EntireRow.Insert
'Rows("95:100").EntireRow.Hidden = True
It works correctly and inserts the lines BUT then the lines get hidden.
I can't understand what is causing this. There is no event code in the worksheet module.
DK.
Sub InsertSch1NotesLine()
Dim myRow As Long
Application.ScreenUpdating = False
'Application.Calculation = xlCalculationManual
myRow = ActiveCell.Row
If Cells(myRow, "E").Value <> 1 Then
MsgBox "Can't insert an Notes Line here", vbOKOnly, "Invalid Line"
Exit Sub
Else
myInput = InputBox("How many lines do you want to insert?", "# of Lines", 1)
'Rows("95:100").EntireRow.Hidden = False
Range("InsertSch1NotesLine").EntireRow.Copy
myInput = myInput * Range("InsertSch1NotesLine").Rows.Count
ActiveCell.Resize(myInput, 1).EntireRow.Insert
'Rows("95:100").EntireRow.Hidden = True