Thread: help with debug
View Single Post
  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

If you used checkboxes from the Control toolbox toolbar, you'll need code like
this:

Option Explicit
Private Sub CheckBox1_Click()

With Me.CheckBox1
If .Value = True Then
.TopLeftCell.Offset(0, 9).Interior.ColorIndex = 3
Else
.TopLeftCell.Offset(0, 9).Interior.ColorIndex = xlNone
End If
End With

End Sub

If you replaced those checkboxes with a checkbox from the Forms toolbar, you
could have one macro assigned to all of the checkboxes.

Option Explicit
Sub testme()

Dim myCBX As CheckBox
Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)

With myCBX
If .Value = xlOn Then
.TopLeftCell.Offset(0, 9).Interior.ColorIndex = 3
Else
.TopLeftCell.Offset(0, 9).Interior.ColorIndex = xlNone
End If
End With

End Sub

Another option would be to use a linkedcell and then use format|conditional
formatting to check that linkedcell's value.

Rusty wrote:

Sub CheckBox3_Click()
'
' CheckBox3_Click Macro
' Macro recorded 2/1/2005 by Geo. Z'
' Keyboard Shortcut: Ctrl+z
'
ActiveCell.Offset(-13, 2).Range("A1").Select
Selection.Font.ColorIndex = 3
End Sub


What I'm trying to do is when the box is checked in "A" the text in "J" is
red, Unchecked = black, down the hole sheet.
I think the "Active cell" line is where to start?
thanks for any help..


--

Dave Peterson