UDF ergänzen
01.10.2022 13:45:55
Paul
ich möchte gerne eine UDF für drei Spalten aktiv schalten. Das geht aber so in meiner u.g. UDF nicht. Da müssten wohl drei Bereiche vorgegeben werden.
Eine Fehlerbereinigung wäre schön.
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Dim Zelle As Range
Application.ScreenUpdating = False
On Error Resume Next
If Not Intersect(Target, Range("D11:D350, H11:H350, J11:J350")) Is Nothing Then
Cancel = True
End If
For Each Zelle In Intersect(Target, Range("D11:D350, H11:H350, J11:J350"))
With Zelle
If .Font.ColorIndex = 1 Then
.Font.ColorIndex = 3
ElseIf .Font.ColorIndex = 3 Then
.Font.ColorIndex = 5
ElseIf .Font.ColorIndex = 5 Then
.Font.ColorIndex = 1
End If
End With
Next
Worksheets("Tabelle1").Range("$M$8").Calculate
Application.ScreenUpdating = True
End Sub
Freundliche GrüßePaul