Toggle "Select Objects" Arrow

jbrouse

Active Member
Joined
Apr 28, 2005
Messages
329
Greetings,

Is there any way to toggle the Select Objects arrow off when a togglebutton is clicked. My Worksheet_BeforeRightClick() function only works when the Select Objects arrow is toggled Off (so that I can Right-Click in a cell). I would like to toggle the Select Object arrow to Off when my togglebutton, "Edit", is clicked.

Is this possible?

Thanks in advance!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I can use CommandBars("Drawing").Controls("Select Objects").Execute to toggle the button on or off, but now I need to modify the IF statement below so that it will only Execute if the button is already toggled as ON. Can anyone please assist me in replacing the .??? with code that works? There is no Object.Value for CommandBar controls, so I can't just put .Value = True.

Code:
Private Sub Edit_Click()

    If Edit.Value = True Then
        If CommandBars("Drawing").Controls("Select Objects").???
             CommandBars("Drawing").Controls("Select Objects").Execute
        End If
    End If

End Sub
 
Upvote 0
Private Sub Edit_Click()

If Edit.Value = True Then
If CommandBars("Drawing").Controls("Select Objects").State = msoButtonDown

CommandBars("Drawing").Controls("Select Objects").Execute
End If
End If

End Sub

For anyone who is interested, I achieved my goal, using the above code. Sometimes attempting to explain it helps you solve your problem! :LOL:
 
Upvote 0

Forum statistics

Threads
1,219,162
Messages
6,146,660
Members
450,706
Latest member
LGVBPP

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