View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default EXCEL Checkboxxx Props.

Maybe you could just use if the checkbox is checked or not:

Option Explicit
Private Sub CheckBox1_Click()
Sheet2.Visible = Not (Me.CheckBox1.Value)
End Sub

Or something like this:
Option Explicit
Private Sub CheckBox1_Click()
Sheet2.Visible = Not (Range(Me.CheckBox1.LinkedCell).Value)
End Sub

Or if you know the cell's location on the same sheet.

Option Explicit
Private Sub CheckBox1_Click()
Sheet2.Visible = Not (me.cells(2,4).Value)
End Sub

I like the first.


"djayc53 <" wrote:

I was hoping to create a spreadsheet in which i could have a workbook
appear/dissapear based on the status (checked/uncheckd) of a checkbox i
have planted in the main workbook. I am familiar with VB, but not with
excel macros and would very much appreciate the help. This is what I
was thinking..

Sub CheckBox1_Click()
If Sheet1.Index(A1:J40, 2, 4) = "TRUE" Then
Sheet2.Visible = xlSheetVisible
Else
End If
If Sheet1.Index(A1:J40, 2, 4) = "FALSE" Then
Sheet2.Visible = xlSheetHidden
End If
End Sub

The cell referenced in the previous code (2, 4) is the cell that I have
associated with the checkox. It's text is either TRUE or FALSE depending
on the state of the box. I might be totally on the wrong track with
this..

Please help. Thanks!

DC

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson