Check Box to hide/show a line thru a series of cells

En4sir

New Member
Joined
Aug 13, 2012
Messages
6
I am trying to show / hide some lines (basically to show that this area is Not applicable)

7d9101

Screenshot is here: https://prominent.wetransfer.com/downloads/6b62206a80eab4f41513892cf4499e9e20180522162354/f9d0a56871addac95a4eecc83dea5b2c20180522162354/7d9101


Code:
Sub CheckBox22_Change()
  If CheckBox22.Value = True Then
    ' CF_Hide_Lines Macro
    ActiveSheet.Shapes.Range(Array("Straight Connector 2")).Select
    ActiveSheet.Shapes.Range(Array("Straight Connector 2", _
        "Straight Connector 4")).Select
    Application.CommandBars("Format Object").Visible = False
    Selection.ShapeRange.Line.Visible = msoFalse
  Else
    ActiveSheet.Shapes.Range(Array("Straight Connector 2")).Select
    ActiveSheet.Shapes.Range(Array("Straight Connector 2", _
        "Straight Connector 4")).Select
    Application.CommandBars("Format Object").Visible = True
    Selection.ShapeRange.Line.Visible = msoTrue
  End If
End Sub


Can someone please help me to understand what I am doing wrong?

Thanks,
Mark
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,222,827
Messages
6,168,482
Members
452,192
Latest member
FengXue

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top