Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Free Floating Toolbar 1

Status
Not open for further replies.

aubie8

IS-IT--Management
Jul 9, 2001
7
US
I have actually done this before, now I cannot remember how.

I want to make my own toolbar (toolbox.. whatever you want to call it) that floats around the worksheet similar to is I did view --> toolbars --> Control Toolbox.

Anyone know how to do this?

Thanks! :)

Chris
 
Hi aubie8,

Click on 'View' on the menu, select 'Toolbars'

Select 'Customize', Click on the 'New' button

Give your toolbar a name (in this case "myCustomToolbar")

Select the 'Commands' tab and drag the required buttons into your toolbar

Go to the 'Toolbars' tab again and click on 'Attach' button and attach your toolbar to the workbook.

You can place the below code in the Workbook Activate event

'
'
With Application.CommandBars("myCustomToolBar")
.Visible = True
.Position = msoBarFloating
End With
'
'

Hope this is what you are looking for.

regards

LSTAN



 
thanks lstan...

how do i programically add my buttons or my own code to its own button?
 
Hi aubie8

Sub ShowToolBar()
'
With Application.CommandBars("myCustomToolBar")
.Visible = True
.Position = msoBarFloating
.Controls(1).OnAction = "myCustomCode1"
.Controls(2).OnAction = "myCustomCode2"
.Controls(3).OnAction = "myCustomCode3"
End With
'
'
End Sub

write the required codes in a module

For example these code are written in Module1

Sub myCustomCode1()
MsgBox "No.1 button clicked."
End Sub

Sub myCustomCode2()
MsgBox "No.2 button clicked."
End Sub

Sub myCustomCode3()
MsgBox "No.3 button clicked."
End Sub

Hope this helps.

Regards :)
LSTAN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top