Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rusty
 
Posts: n/a
Default help with debug

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..
  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi Rusty

From my understanding of your question you have one check box in A1 and when it is checked you what the whole of column J to go red, if so, right mouse click on the check box and choose view code and then copy & paste the following into the procedure that is created it should give you what you want:

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
ActiveSheet.Columns(10).Font.ColorIndex = 3
Else
ActiveSheet.Columns(10).Font.ColorIndex = 1
End If

End Sub

---
If i've misunderstood the question please let us know.

Cheers
JulieD

"Rusty" wrote in message ...
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..
  #3   Report Post  
Rusty
 
Posts: n/a
Default

Sorry I wasn't clear
I have a check box in each row in "A" when it is checked I want "J" in that row red.
Thank You for the reply
"JulieD" wrote in message ...
Hi Rusty

From my understanding of your question you have one check box in A1 and when it is checked you what the whole of column J to go red, if so, right mouse click on the check box and choose view code and then copy & paste the following into the procedure that is created it should give you what you want:

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
ActiveSheet.Columns(10).Font.ColorIndex = 3
Else
ActiveSheet.Columns(10).Font.ColorIndex = 1
End If

End Sub

---
If i've misunderstood the question please let us know.

Cheers
JulieD

"Rusty" wrote in message ...
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..
  #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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"