Hello
Looking for VBA code that show selection pane if its closed
and close it if its showing
Thanks
Hello
Looking for VBA code that show selection pane if its closed
and close it if its showing
Thanks
Maybe :
Run it to toggle, on .. off .. on .. off .. on .. off .. .. .. ..Sub Test() CommandBars.ExecuteMso ("SelectionPane") End Sub
1. I care dog
2. I am a loop maniac
3. Forum rules link : Click here
3.33. Don't forget to mark the thread as solved, this is important
You can use this to toggle selection pane state
you can use this to determine stateapplication.CommandBars.ExecuteMso "SelectionPane"
if application.CommandBars.GetPressedMso("SelectionPane") then msgbox "Showing" end if
Very nice. Thank you. Big help.
The extra test was essential. W/o current state I could not switch as desired. Each worksheet now sets up the way I want.
While I am tring with vba code
the pane now is not showing
even when I click it from find
even also in new file
Maybe the pane position is out of screen, try to run this code :
If you click manually by hand, and even trying it on new file, and the pane is not shown, the culprit is not the VBA, but must be something else (e.g. the position of pane, interfere from third party addon, etc).Sub Test2() On Error Resume Next With CommandBars("Selection and Visibility") .Position = msoBarRight .Enabled = True .Visible = True End With End Sub
Last edited by karedog; 12-31-2022 at 07:33 AM. Reason: More complete code, happy new year..
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks