I have a VBA that is currently working correctly to unhide various sheets based on when their respective checkbox is checked. Now I want to also unhide several rows on another tab called "new business checklist". This is what I have tried but I can't seem to make it work. The red text was what I am thinking will unhide the rows. Trying to unhide rows 25 to 42.
Private Sub CheckBox1_Click()
On Error Resume Next
ThisWorkbook.Sheets("package risk analysis").Visible = CheckBox1.Value
End Sub
Private Sub unhidespecificrows()
ThisWorkbook.Sheets("new business checklist").Visible = CheckBox1.Value
For i = 25 To 42
Rows(i).Hidden = False
Next i
End Sub
Private Sub CheckBox2_Click()
On Error Resume Next
ThisWorkbook.Sheets("auto risk analysis").Visible = CheckBox2.Value
End Sub
Private Sub CheckBox3_Click()
On Error Resume Next
ThisWorkbook.Sheets("excessumbrella risk analysis").Visible = CheckBox3.Value
End Sub
Private Sub CheckBox4_Click()
On Error Resume Next
ThisWorkbook.Sheets("reinsurance").Visible = CheckBox4.Value
End Sub
Private Sub CommandButton1_Click()
ThisWorkbook.Sheets("Notes").Visible = True
ThisWorkbook.Sheets("Notes").Select
ThisWorkbook.Sheets("Notes").Range("A13").Select
ActiveCell.EntireRow.Insert Shift:=xlDown
Sheets("Notes").Range("A13:B13").Select
Selection.Borders.Weight = xlThin
ThisWorkbook.Sheets("Notes").Range("A13").Select
Selection.Formula = "=today()"
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Columns.AutoFit
End Sub
Private Sub CheckBox1_Click()
On Error Resume Next
ThisWorkbook.Sheets("package risk analysis").Visible = CheckBox1.Value
End Sub
Private Sub unhidespecificrows()
ThisWorkbook.Sheets("new business checklist").Visible = CheckBox1.Value
For i = 25 To 42
Rows(i).Hidden = False
Next i
End Sub
Private Sub CheckBox2_Click()
On Error Resume Next
ThisWorkbook.Sheets("auto risk analysis").Visible = CheckBox2.Value
End Sub
Private Sub CheckBox3_Click()
On Error Resume Next
ThisWorkbook.Sheets("excessumbrella risk analysis").Visible = CheckBox3.Value
End Sub
Private Sub CheckBox4_Click()
On Error Resume Next
ThisWorkbook.Sheets("reinsurance").Visible = CheckBox4.Value
End Sub
Private Sub CommandButton1_Click()
ThisWorkbook.Sheets("Notes").Visible = True
ThisWorkbook.Sheets("Notes").Select
ThisWorkbook.Sheets("Notes").Range("A13").Select
ActiveCell.EntireRow.Insert Shift:=xlDown
Sheets("Notes").Range("A13:B13").Select
Selection.Borders.Weight = xlThin
ThisWorkbook.Sheets("Notes").Range("A13").Select
Selection.Formula = "=today()"
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Columns.AutoFit
End Sub