Hi All,
I've got a Checkbox (Active x control) which is assigned to a drop down. Each drop down hides/unhides various rows.
IE: Drop down 1 will unhide rows 10:20 and so forth.
Currently, my checkbox moves depending on what is hidden and not hidden whereas I want it to stay to row 20 for example so it only shows if this row in visible
Below is my code currently hiding it. Is there a way I can lock it so its only visible in that specific place / cell?
Sub Show_Stats()
'
' Show_Stats
'
Application.EnableEvents = False 'Stop macro from looping.
Application.ScreenUpdating = False 'Hiding the execution of the macro.
If (Range("B37").Value = "+") Then
ActiveSheet.Shapes("CheckBox1").Visible = True
Rows("40:46").Select
Selection.EntireRow.Hidden = False
Range("B37").Select
ActiveCell.FormulaR1C1 = "-"
Range("B37").Select
Else
Rows("40:46").Select
ActiveSheet.Shapes("CheckBox1").Visible = False
Selection.EntireRow.Hidden = True
Range("B37").Select
ActiveCell.FormulaR1C1 = "+"
Range("B37").Select
End If
Application.EnableEvents = True
Application.ScreenUpdating = True
'
End Sub
I've got a Checkbox (Active x control) which is assigned to a drop down. Each drop down hides/unhides various rows.
IE: Drop down 1 will unhide rows 10:20 and so forth.
Currently, my checkbox moves depending on what is hidden and not hidden whereas I want it to stay to row 20 for example so it only shows if this row in visible
Below is my code currently hiding it. Is there a way I can lock it so its only visible in that specific place / cell?
Sub Show_Stats()
'
' Show_Stats
'
Application.EnableEvents = False 'Stop macro from looping.
Application.ScreenUpdating = False 'Hiding the execution of the macro.
If (Range("B37").Value = "+") Then
ActiveSheet.Shapes("CheckBox1").Visible = True
Rows("40:46").Select
Selection.EntireRow.Hidden = False
Range("B37").Select
ActiveCell.FormulaR1C1 = "-"
Range("B37").Select
Else
Rows("40:46").Select
ActiveSheet.Shapes("CheckBox1").Visible = False
Selection.EntireRow.Hidden = True
Range("B37").Select
ActiveCell.FormulaR1C1 = "+"
Range("B37").Select
End If
Application.EnableEvents = True
Application.ScreenUpdating = True
'
End Sub