I'm working on adding custom menu items that control views of the worksheet. This requires tracking current view settings etc. Therefore I'd like to use a select statement to determine which menu item was selected. Can you use the action statement to pass a value such as .OnAction = "ViewSelection(1)"?
I can always send it to a sub which will then call the ViewSelection sub with the value but that seems less elegant.
Here's the code snippets:
Menu item:
With .Controls.Add(Type:=msoControlButton)
.Caption = "All"
.OnAction = "ViewSelection(1)"
.FaceId = 1098
End With
ViewSelection skeleton:
Sub ViewSelection(intOption As Integer)
Select Case intOption
Case 1
Call Show_All_Columns
Case 2
….
Case Else
…….
End Select
End Sub
Thanks in advance.
Glenn
I can always send it to a sub which will then call the ViewSelection sub with the value but that seems less elegant.
Here's the code snippets:
Menu item:
With .Controls.Add(Type:=msoControlButton)
.Caption = "All"
.OnAction = "ViewSelection(1)"
.FaceId = 1098
End With
ViewSelection skeleton:
Sub ViewSelection(intOption As Integer)
Select Case intOption
Case 1
Call Show_All_Columns
Case 2
….
Case Else
…….
End Select
End Sub
Thanks in advance.
Glenn