Gruppe
Menue
Problem
Wie kann ich mir die Daten der aktuellen Zeile im Zellkontextmenü anzeigen lassen?
ClassModule: DieseArbeitsmappe
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call CmdDelete
End Sub
StandardModule: basMain
Sub CmdDelete()
On Error GoTo ERRORHANDLER
Application.CommandBars("DatenMaske").Delete
ERRORHANDLER:
End Sub
ClassModule: Tabelle1
Private Sub Worksheet_BeforeRightClick(ByVal _
Target As Range, Cancel As Boolean)
Dim oBar As CommandBar
Dim oBtn As CommandBarButton
Dim iCol As Integer
Cancel = True
Call CmdDelete
Set oBar = Application.CommandBars.Add("DatenMaske", msoBarPopup)
Do Until IsEmpty(Cells(1, iCol + 1))
Set oBtn = oBar.Controls.Add
With oBtn
.Caption = Cells(1, iCol + 1).Value & ": " & _
Cells(ActiveCell.Row, iCol + 1).Value
End With
iCol = iCol + 1
Loop
oBar.ShowPopup
End Sub