J
Jorgen Bondesen
Hi NG
When I'm right clicking in a cell, I want my owen menu.
I can do this.
The menu depends on text in 5, 10 og 20 consecutive cells. I'm using the
text.
snip **** start
Dim lCount As Long
For lCount = 1 To lListCount
Dim MyList
MyList = data(lCount) '// text from cells
Dim cBut As CommandBarButton
Set cBut = .CommandBars("Cell").Controls.Add(Type:=msoControlButton,
Temporary:=True)
With cBut
.Caption = MyList
.Style = msoButtonIconAndCaption ' msoButtonCaption
.FaceId = lCount + 50
.SetFocus
.OnAction = "RunMe"
.Tag = lCount
End With
snip **** end
When I'm clicking on e.g 3th line in right click menu ("Cell"), how can I
knew this, if I only have .OnAction = "RunMe"
If .OnAction = "RunMe_" & lCount then I must have aboute 30 macros or trap
error, because I do not have any macro, and read trapinfo or macro name and
number.
Perhaps and quite different approach?
When I'm right clicking in a cell, I want my owen menu.
I can do this.
The menu depends on text in 5, 10 og 20 consecutive cells. I'm using the
text.
snip **** start
Dim lCount As Long
For lCount = 1 To lListCount
Dim MyList
MyList = data(lCount) '// text from cells
Dim cBut As CommandBarButton
Set cBut = .CommandBars("Cell").Controls.Add(Type:=msoControlButton,
Temporary:=True)
With cBut
.Caption = MyList
.Style = msoButtonIconAndCaption ' msoButtonCaption
.FaceId = lCount + 50
.SetFocus
.OnAction = "RunMe"
.Tag = lCount
End With
snip **** end
When I'm clicking on e.g 3th line in right click menu ("Cell"), how can I
knew this, if I only have .OnAction = "RunMe"
If .OnAction = "RunMe_" & lCount then I must have aboute 30 macros or trap
error, because I do not have any macro, and read trapinfo or macro name and
number.
Perhaps and quite different approach?