Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Toggle Button in a Toolbar

Can anyone tell me how to create a toggle button in a Toolbar in Excel
VBA?

Thanks,
Amit

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Toggle Button in a Toolbar

Here is an example that uses click to set the calculation mode to manual,
shift-click to automatic, and changes the tooltiptext to show whixh mode it
is in.

Sub SetCalculateMode() 'Shifted is automatic, unshifted is manual
Dim sMode As String
Dim nState As Long


If GetKeyState(vkShift) < 0 Then
Application.Calculation = xlAutomatic
sMode = "Automatic"
nState = msoButtonDown
Else
Application.Calculation = xlManual
sMode = "Manual"
nState = msoButtonUp
End If
With Application.CommandBars.ActionControl
.TooltipText = "Calculation mode is " & sMode
.State = nState
End With


End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"amitmohantybbsr" wrote in message
ups.com...
Can anyone tell me how to create a toggle button in a Toolbar in Excel
VBA?

Thanks,
Amit



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Toggle Button in a Toolbar

Thanks for your reply. I will try to implement it.

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
Toolbar Toggle Stan Brown Excel Discussion (Misc queries) 0 April 28th 07 11:42 PM
Auto Filter Toolbar Button Does not Toggle Pastel Hughes Excel Discussion (Misc queries) 2 October 26th 06 09:25 PM
Adding .xla button for Toggle Calculation Button Mike Excel Programming 5 August 19th 05 01:55 PM
Assign ShortCut-key To Toggle VBA-toolbar? SIGE Excel Programming 4 April 19th 05 04:45 PM
Use Toolbar Button to Toggle Addin Rob Excel Programming 4 January 27th 05 10:16 PM


All times are GMT +1. The time now is 12:29 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"