Hi,
I'm new to VBA and wanted to try to have a bit of fun first.
I have two sheets, called Settings and Spell_List (It is for DnD).
In Settings I can cross 3 check boxes, which depending on the selected check box, will hide certain rows in the other sheet.
This is what i have so far. If I cross off box P7, then it should hide according to above. And different rows if the other are checked.
But nothing happens at the moment.
I'm missing something here, I just don't know what.
Rune
I'm new to VBA and wanted to try to have a bit of fun first.
I have two sheets, called Settings and Spell_List (It is for DnD).
In Settings I can cross 3 check boxes, which depending on the selected check box, will hide certain rows in the other sheet.
VBA Code:
Sub MoonPhase()
If Worksheets("Settings").Range("P7").Value = "TRUE" Then
Worksheets("Spell_List").Rows("13:14").EntireRow.Hidden = True
Worksheets("Spell_List").Rows("20:21").EntireRow.Hidden = True
Worksheets("Spell_List").Rows("25:26").EntireRow.Hidden = True
Worksheets("Spell_List").Rows("31:32").EntireRow.Hidden = True
ElseIf Worksheets("Settings").Range("P9").Value = "TRUE" Then
Worksheets("Spell_List").Rows("12,14").EntireRow.Hidden = True
Worksheets("Spell_List").Rows("19,21").EntireRow.Hidden = True
Worksheets("Spell_List").Rows("24,26").EntireRow.Hidden = True
Worksheets("Spell_List").Rows("30,32").EntireRow.Hidden = True
ElseIf Worksheets("Settings").Range("P11").Value = "TRUE" Then
Worksheets("Spell_List").Rows("12:13").EntireRow.Hidden = True
Worksheets("Spell_List").Rows("19:20").EntireRow.Hidden = True
Worksheets("Spell_List").Rows("24:25").EntireRow.Hidden = True
Worksheets("Spell_List").Rows("30,31").EntireRow.Hidden = True
End If
End Sub
This is what i have so far. If I cross off box P7, then it should hide according to above. And different rows if the other are checked.
But nothing happens at the moment.
I'm missing something here, I just don't know what.
Rune