Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Floating Vertical Menu bar....Please help


The following code will make a floating horizontal menu bar, but how can
I make it a vertical menu bar? What changes should I make in the code?
Please advice.

Thanks in advance,
Shashi


Option Explicit

Const ToolBarName As String = "User Options"

'This code runs whenever the workbook is open
Sub Workbook_Open()

Call CreateMenubar

End Sub

'This code runs before the workbook is closed
Private Sub Workbook_BeforeClose(Cancel As Boolean)

MsgBox "This code ran at Excel close!"
Call RemoveMenubar

End Sub


'This code removes the floating tool bar before closing
Sub RemoveMenubar()

On Error Resume Next
Application.CommandBars(ToolBarName).Delete
On Error GoTo 0

End Sub

'This code creats the floating tool bar
Sub CreateMenubar()

Dim iCtr As Long
Dim temp As Long

Dim MacNames As Variant
Dim CapNamess As Variant
Dim TipText As Variant

Call RemoveMenubar

MacNames = Array("aaa", "ab", _
"bbb")

CapNamess = Array("AAA Caption", "ab caption", _
"BBB Caption")

TipText = Array("AAA tip", "AB tip", _
"BBB tip")

With Application.CommandBars.Add
..Name = ToolBarName
..Left = 950
..Top = 100
..Width = 10000
..Protection = msoBarNoMove
..Visible = True
..Position = msoBarFloating



For iCtr = LBound(MacNames) To UBound(MacNames)

With .Controls.Add(Type:=msoControlButton)
..BeginGroup = True
..OnAction = "'" & ThisWorkbook.Name & "'!" &
MacNames(iCtr)
..Caption = CapNamess(iCtr)
..Style = msoButtonIconAndCaption
..FaceId = 71 + iCtr
..TooltipText = TipText(iCtr)


End With

Next iCtr
End With
End Sub


--
shashi1515
------------------------------------------------------------------------
shashi1515's Profile: http://www.excelforum.com/member.php...o&userid=31109
View this thread: http://www.excelforum.com/showthread...hreadid=507744

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Floating Vertical Menu bar....Please help


Hello Shashi1515,

You need to reduce the width of the toolbar when you create it. The
width now is equal to 10000. Set it to a little larger than a single
buttons width, about 22. This should give a column of single buttons in
a vertical menu.

Sincerely.
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=507744

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Floating Vertical Menu bar....Please help


Leith,

I tried with 22, it didn't work. The result is same horizontal bar. I
even tried with other numbers like 2, 5, 10 etc. None of them made it
horizontal. :-(

Thanks,
Shashi


--
shashi1515
------------------------------------------------------------------------
shashi1515's Profile: http://www.excelforum.com/member.php...o&userid=31109
View this thread: http://www.excelforum.com/showthread...hreadid=507744

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Floating Vertical Menu bar....Please help

Shashi,
Set the width dimension after the buttons are added.
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"shashi1515" wrote in message
The following code will make a floating horizontal menu bar, but how can
I make it a vertical menu bar? What changes should I make in the code?
Please advice.
Thanks in advance,
Shashi



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Floating Vertical Menu bar....Please help


Thanks Jim....it worked........Thanks a lot.

~ Shash

--
shashi151
-----------------------------------------------------------------------
shashi1515's Profile: http://www.excelforum.com/member.php...fo&userid=3110
View this thread: http://www.excelforum.com/showthread.php?threadid=50774

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
Fill color floating menu linglc Excel Discussion (Misc queries) 2 March 5th 10 08:57 AM
How do I make a vertical floating bar chart? danke_shane Charts and Charting in Excel 1 August 2nd 07 12:51 PM
Vertical menu bar- Excel Bob Mulcrone Excel Discussion (Misc queries) 2 August 10th 06 12:32 AM
Create floating button based on button click in menu ExcelMonkey Excel Programming 2 October 12th 05 06:43 PM
Forms? Want floating user-option menu in worksheet. Mark Excel Programming 0 May 23rd 05 11:11 PM


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