+ Reply to Thread
Results 1 to 4 of 4

help with debug

  1. #1
    Rusty
    Guest

    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. #2
    JulieD
    Guest

    Re: help with debug

    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" <[email protected]> wrote in message news:[email protected]...
    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. #3
    Rusty
    Guest

    Re: help with debug

    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" <[email protected]> wrote in message news:%[email protected]...
    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" <[email protected]> wrote in message news:[email protected]...
    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. #4
    Dave Peterson
    Guest

    Re: help with debug

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1