Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default maximum number of Right-click options

I want to use the right click function to allow a user to select a machine
code. There are 48 machine codes but when I write the code it only displays
25 in the right-click menu, is there a way beyond this limitation?

If not, what are my other options?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default maximum number of Right-click options

I would put a combobox dropdown on the right-click menu. E.g.,


Sub AAA()

Dim Ctrl As Office.CommandBarComboBox
Set Ctrl = Application.CommandBars("Cell").Controls.Add( _
Type:=msoControlComboBox, temporary:=True)
With Ctrl
..Caption = "Machine ID"
..AddItem "A"
..AddItem "B"
..AddItem "C"
..OnAction = "DoMachine"
End With

End Sub

Sub DoMachine()

With Application.CommandBars.ActionControl
ActiveCell.Value = .List(.ListIndex)
End With

End Sub




--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Paulymon" wrote in message
...
I want to use the right click function to allow a user to select
a machine
code. There are 48 machine codes but when I write the code it
only displays
25 in the right-click menu, is there a way beyond this
limitation?

If not, what are my other options?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default maximum number of Right-click options

That worked nicely, thank you. Since this is the only item on the right
click menu is there a way to automatically expand the combo box so it shows
the list as if the user has already clicked on the down arrow?

"Chip Pearson" wrote:

I would put a combobox dropdown on the right-click menu. E.g.,


Sub AAA()

Dim Ctrl As Office.CommandBarComboBox
Set Ctrl = Application.CommandBars("Cell").Controls.Add( _
Type:=msoControlComboBox, temporary:=True)
With Ctrl
..Caption = "Machine ID"
..AddItem "A"
..AddItem "B"
..AddItem "C"
..OnAction = "DoMachine"
End With

End Sub

Sub DoMachine()

With Application.CommandBars.ActionControl
ActiveCell.Value = .List(.ListIndex)
End With

End Sub




--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Paulymon" wrote in message
...
I want to use the right click function to allow a user to select
a machine
code. There are 48 machine codes but when I write the code it
only displays
25 in the right-click menu, is there a way beyond this
limitation?

If not, what are my other options?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default maximum number of Right-click options

I don't believe this is possible.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Paulymon" wrote in message
...
That worked nicely, thank you. Since this is the only item on
the right
click menu is there a way to automatically expand the combo box
so it shows
the list as if the user has already clicked on the down arrow?

"Chip Pearson" wrote:

I would put a combobox dropdown on the right-click menu. E.g.,


Sub AAA()

Dim Ctrl As Office.CommandBarComboBox
Set Ctrl = Application.CommandBars("Cell").Controls.Add( _
Type:=msoControlComboBox, temporary:=True)
With Ctrl
..Caption = "Machine ID"
..AddItem "A"
..AddItem "B"
..AddItem "C"
..OnAction = "DoMachine"
End With

End Sub

Sub DoMachine()

With Application.CommandBars.ActionControl
ActiveCell.Value = .List(.ListIndex)
End With

End Sub




--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Paulymon" wrote in
message
...
I want to use the right click function to allow a user to
select
a machine
code. There are 48 machine codes but when I write the code
it
only displays
25 in the right-click menu, is there a way beyond this
limitation?

If not, what are my other options?






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
Axis Options - Minimum and Maximum Values Tom Charts and Charting in Excel 2 January 8th 09 10:48 PM
CHANGE RIGHT CLICK OPTIONS gams sb Excel Discussion (Misc queries) 2 May 27th 08 04:04 PM
Right click delete options LDP Analyst[_2_] Excel Discussion (Misc queries) 2 March 13th 08 04:45 PM
how do I add more toolbar options to my right click options Rosie Excel Discussion (Misc queries) 1 August 11th 06 04:52 PM
Amending Right-Click Options Matt Excel Programming 5 May 21st 04 01:31 PM


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

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

About Us

"It's about Microsoft Excel"