ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Unhiding Check Boxes in Excel 2002 (https://www.excelbanter.com/excel-discussion-misc-queries/220794-unhiding-check-boxes-excel-2002-a.html)

mwl

Unhiding Check Boxes in Excel 2002
 
I've got a number of check boxes which are currently hidden in rows 16:19.

How can you automatically unhide them when another check box (which isn't
hidden) is selected?

I've tried the following code but it objects when it gets to
"ActiveSheet.Shapes("CheckBox12").Select":

Private Sub CheckBox1_Click()

Rows("15:20").Select
Range("A20").Activate
Selection.EntireRow.Hidden = False
ActiveSheet.Shapes("CheckBox12").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox13").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox14").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox15").Select
Selection.Visible = True

End Sub

Dave Peterson

Unhiding Check Boxes in Excel 2002
 
Me.CheckBox1.Visible = True

This code is in the worksheet module, right?

Me refers to the sheet that owns the code.



MWL wrote:

I've got a number of check boxes which are currently hidden in rows 16:19.

How can you automatically unhide them when another check box (which isn't
hidden) is selected?

I've tried the following code but it objects when it gets to
"ActiveSheet.Shapes("CheckBox12").Select":

Private Sub CheckBox1_Click()

Rows("15:20").Select
Range("A20").Activate
Selection.EntireRow.Hidden = False
ActiveSheet.Shapes("CheckBox12").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox13").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox14").Select
Selection.Visible = True
ActiveSheet.Shapes("CheckBox15").Select
Selection.Visible = True

End Sub


--

Dave Peterson


All times are GMT +1. The time now is 09:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com