Wie kann ich über mehrere Arbeitsblätter jeweils in einem Bereich von B7-R22
mit einem Doppelklick die aktive Zelle via VBA mit einem "x" markieren?
Vielen Dank
Gerhard
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("b7:r22")) Is Nothing Then
Target.Value = "x"
Cancel = True
End If
End Sub
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
If Sh.Name = "Tabelle1" Or Sh.Name = "Tabelle2" Then
If Not Intersect(Target, Range("B7:R22")) Is Nothing Then
Target = "x"
Cancel = True
End If
End If
End Sub
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
If Sh.Index > 1 Then
If Not Intersect(Target, Range("B7:R22")) Is Nothing Then
If IsEmpty(Target) Then
Target = "x"
Else
Target = ""
End If
Cancel = True
End If
End If
End Sub