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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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