Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default checkBox & ListBox on ToolBar...

Is that possible to have an checkBox and/or ListBox on
the toolbar.... so the code bellow will be run if checkBox is check, and
listBox
pointing to currency...

Thank You

/ How to modify the content of the current Cell in Excel
// put this code in Excel/VisualBasic/MsProject/ExCellObject/Worksheet1
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As String
x = Target.Value
If Right(x, 1) = "*" Then
Target.Value = Replace(x, "*", "000")
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default checkBox & ListBox on ToolBar...

this needs tweaking, but is enough to get you started:

Option Explicit
Global drpdwn As CommandBarComboBox

Sub SetMenuBar()
Dim newbar As CommandBar
Dim cntrl As CommandBarButton
If BarExists Then
CommandBars("Patrick").Delete
End If
Set newbar = CommandBars.Add("Patrick", msoBarFloating)
Set drpdwn = newbar.Controls.Add(msoControlComboBox)
With drpdwn
.Caption = "Currency"
.AddItem "USD"
.AddItem "EUR"
.AddItem "JPY"
End With
Set cntrl = newbar.Controls.Add(msoControlButton)
With cntrl
.Caption = "Run FX"
.OnAction = "RunFX"
End With
newbar.Visible = True
End Sub
Function BarExists() As Boolean
On Error Resume Next
Dim cb As CommandBar
Set cb = CommandBars("Patrick")
BarExists = Err.Number = 0
On Error GoTo 0
End Function
Sub RunFX()
Dim ccy As String
' YOUR CODE HERE
If drpdwn Is Nothing Then SetMenuBar
If drpdwn.Text = "" Then
ccy = "*"
Else
ccy = drpdwn.Text
End If
End Sub


"Johan2000" wrote:

Is that possible to have an checkBox and/or ListBox on
the toolbar.... so the code bellow will be run if checkBox is check, and
listBox
pointing to currency...

Thank You

/ How to modify the content of the current Cell in Excel
// put this code in Excel/VisualBasic/MsProject/ExCellObject/Worksheet1
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As String
x = Target.Value
If Right(x, 1) = "*" Then
Target.Value = Replace(x, "*", "000")
End If
End Sub

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
how to have checkBox in ToolBar (Icon) ? Johan2000 Excel Programming 0 March 9th 08 02:48 AM
Adding CheckBox Caption to a Listbox Peterd Excel Programming 2 August 22nd 05 01:03 PM
VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) modjoe23 Excel Programming 3 August 18th 05 02:35 PM
listbox with checkbox or radiobutton groups Mark[_36_] Excel Programming 2 February 12th 04 02:44 PM
Listbox w/CheckBox Options Bob Salvato Excel Programming 1 September 2nd 03 04:44 PM


All times are GMT +1. The time now is 09:24 PM.

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"