View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_391_] joel[_391_] is offline
external usenet poster
 
Posts: 1
Default Sheets visible toggle code


Assuming the checkbox number and the sheet numbers are the same


Private Sub CheckBox2_Click()
For Each bx In ActiveSheet.OLEObjects
Objtype = TypeName(bx.Object)
If Objtype = "CheckBox" Then
'extract number of box
boxnum = Val(Replace(bx.Name, "CheckBox", ""))
If bx.Object.Value = True Then
Sheets(boxnum).Visible = True
Else
Sheets(boxnum).Visible = False
End If
End If

Next bx

End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=164975

Microsoft Office Help