Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Location
    Vancouver, Br. Columbia
    Posts
    223
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changeing color of brackets with Code (Excel 2000)

    My code below works with a check box,
    The problem I have is that it only works if I am on the sheet where the shape is. the check box is on another sheet and
    when click there the code breaks. anyway around this other then moving the check box onto the shape sheet?


    Private Sub Plug5chk_Click()
    'Check box hides proppant schedule 2 if not picked!
    If Plug5chk.Value = False Then
    Worksheets("Plug Job Info").Range("16:24").EntireRow.Hidden = True
    Sheets("Plug Job Info").Shapes("BracketPlug5").Select
    Selection.ShapeRange.Line.ForeColor.SchemeColor = 9
    Else
    Worksheets("Plug Job Info").Range("16:24").EntireRow.Hidden = False
    Sheets("Plug Job Info").Shapes("BracketPlug5").Select
    Selection.ShapeRange.Line.ForeColor.SchemeColor = 8
    End If
    End Sub

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changeing color of brackets with Code (Excel 2000)

    Try:

    <code>
    Private Sub Plug5chk_Click()
    'Check box hides proppant schedule 2 if not picked!
    If Plug5chk.Value = False Then
    Worksheets("Plug Job Info").Range("16:24").EntireRow.Hidden = True
    Sheets("Plug Job Info").Shapes("BracketPlug5").ShapeRange.Line.Fore Color.SchemeColor = 9
    Else
    Worksheets("Plug Job Info").Range("16:24").EntireRow.Hidden = False
    Sheets("Plug Job Info").Shapes("BracketPlug5").ShapeRange.Line.Fore Color.SchemeColor = 8
    End If
    End Sub
    </code>
    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    May 2005
    Location
    Vancouver, Br. Columbia
    Posts
    223
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changeing color of brackets with Code (Excel 2000)

    no change I get a message saying object does not support this method

    run time error 438

    Might be easier to remove the brackets

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Changeing color of brackets with Code (Excel 2

    Does this work:
    <pre>Private Sub Plug5chk_Click()
    'Check box hides proppant schedule 2 if not picked!
    If Plug5Chk.Value = False Then
    Worksheets("Plug Job Info").Range("16:24").EntireRow.Hidden = True
    Sheets("Plug Job Info").Shapes("BracketPlug5").Line.ForeColor.Schem eColor = 9
    Else
    Worksheets("Plug Job Info").Range("16:24").EntireRow.Hidden = False
    Sheets("Plug Job Info").Shapes("BracketPlug5").Line.ForeColor.Schem eColor = 8
    End If
    End Sub
    </pre>

    ?
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    2 Star Lounger
    Join Date
    May 2005
    Location
    Vancouver, Br. Columbia
    Posts
    223
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changeing color of brackets with Code (Excel 2

    yes that works, it was be the .shaperange that cause the code not to work in in Legares and mine
    thank you,

Posting Permissions

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