captainchaos666
Goto Top

mit VBA erzeugtem Kontextmenü taucht an nicht gewollten Stellen auf

Hallo,
ich sollte mal euere Hilfe haben. Ich habe mit VBA eine Kontexmenü für die Zellen C7 bis C99 programmiert. Jetzt kommt aber dieses Kontextmenü an allen Zellen (A1 bis xy)

Frage 1: Warum?
Frage 2: Wie mach ich es richtig

Dank Euch

Gruß Alex


VBA Code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'***

If Not Intersect(Target, Range("C7:C99")) Is Nothing Then
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="Auswahl A, Auswahl B, Auswahl C"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If

End Sub

Content-Key: 79000

Url: https://administrator.de/contentid/79000

Printed on: April 26, 2024 at 17:04 o'clock