Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Select Object Button

I am using Excel 2000. Near the bottom left corner is the Select Object
button with the arrow cursor icon. Can this button be toggled on and off
using VBA code? If so, how? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Select Object Button

I think this will work (I don't have XL2000, but it works in my copy of
XL2003)...

Sub ToggleSelectObject()
Dim ctl As Object
For Each ctl In CommandBars("Drawing").Controls
If ctl.ID = 182 Then
ctl.Visible = Not ctl.Visible
End If
Next ctl
End Sub

Rick


"pan65" wrote in message
...
I am using Excel 2000. Near the bottom left corner is the Select Object
button with the arrow cursor icon. Can this button be toggled on and off
using VBA code? If so, how? Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Select Object Button

If you mean toggle up/down simply

CommandBars.FindControl(ID:=182).Execute

or with a bit more control

Sub Toggle182(nState As Long)
Dim ctr As CommandBarButton
Set ctr = Application.CommandBars.FindControl(ID:=182)
If ctr.State < nState Then
ctr.Execute
End If
End Sub

Sub test()
Toggle182 msoButtonDown ' -1
Stop
Toggle182 msoButtonUp ' 0

End Sub


Regards,
Peter T


"pan65" wrote in message
...
I am using Excel 2000. Near the bottom left corner is the Select Object
button with the arrow cursor icon. Can this button be toggled on and off
using VBA code? If so, how? Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Select Object Button

I read the "toggle on and off" part of your question as asking to make the
button visible or invisible. I see Peter T read your question differently.
You might have to clarify for us exactly what you are looking for.

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
I think this will work (I don't have XL2000, but it works in my copy of
XL2003)...

Sub ToggleSelectObject()
Dim ctl As Object
For Each ctl In CommandBars("Drawing").Controls
If ctl.ID = 182 Then
ctl.Visible = Not ctl.Visible
End If
Next ctl
End Sub

Rick


"pan65" wrote in message
...
I am using Excel 2000. Near the bottom left corner is the Select Object
button with the arrow cursor icon. Can this button be toggled on and off
using VBA code? If so, how? Thanks.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Select Object Button

Thanks that was exactly what I was looking for.

"Peter T" wrote:

If you mean toggle up/down simply

CommandBars.FindControl(ID:=182).Execute

or with a bit more control

Sub Toggle182(nState As Long)
Dim ctr As CommandBarButton
Set ctr = Application.CommandBars.FindControl(ID:=182)
If ctr.State < nState Then
ctr.Execute
End If
End Sub

Sub test()
Toggle182 msoButtonDown ' -1
Stop
Toggle182 msoButtonUp ' 0

End Sub


Regards,
Peter T


"pan65" wrote in message
...
I am using Excel 2000. Near the bottom left corner is the Select Object
button with the arrow cursor icon. Can this button be toggled on and off
using VBA code? If so, how? Thanks.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select next object Mike Excel Programming 4 May 2nd 06 02:54 PM
Option button object proeprties or object not found in vba Pete Straman S via OfficeKB.com Excel Programming 0 August 31st 05 05:49 PM
automatically select object references Job Excel Programming 0 February 3rd 05 09:41 PM
Can't select macro button after other button is pressed C. Campbell Excel Programming 1 November 30th 04 07:46 PM
Highlight/Select contents of object with focus andy[_5_] Excel Programming 2 January 15th 04 02:44 PM


All times are GMT +1. The time now is 02:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"