mit folgendem Code wird im Bereich A49:F52 die Schrift fett und wieder zurück per Doppelclik.
Wie kann man den Code erweitern, das in der angeklickten Zelle dieses Bereiches zur fetten Formatierung noch der untere Rahmen der Zelle gesetz wird?
Eine perfekte Lösung wäre noch der Zusatz, das pro Zeile nur eine Zelle die Formatierung Fett und Rahmen unten enthalten kann, die anderen 5 normal formatiert.
Vielen Dank
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
If Not Intersect(Target, Range("a33:a37")) Is Nothing Then
Target = IIf(Target = "S", "£", "S")
Cancel = True
End If
If Not Intersect(Target, Range("q33:q37")) Is Nothing Then
Target = IIf(Target = "S", "£", "S")
Cancel = True
End If
If Not Intersect(Target, Range("r40:r41")) Is Nothing Then
Target = IIf(Target = "S", "£", "S")
Cancel = True
End If
If Not Intersect(Target, Range("a63:a65")) Is Nothing Then
Target = IIf(Target = "S", "£", "S")
Cancel = True
End If
If Not Intersect(Target, Range("q63:q65")) Is Nothing Then
Target = IIf(Target = "S", "£", "S")
Cancel = True
End If
If Not Intersect(Target, Range("s67")) Is Nothing Then
Target = IIf(Target = "S", "£", "S")
Cancel = True
End If
If Not Intersect(Target, Range("z67")) Is Nothing Then
Target = IIf(Target = "S", "£", "S")
Cancel = True
End If
Dim RaBereich As Range
Set RaBereich = Range("A49:F52")
If Intersect(Target, RaBereich) Is Nothing Then Exit Sub
Application.EnableEvents = False
Cancel = True
If Selection.Font.FontStyle = "Standard" Then
Selection.Font.FontStyle = "Fett"
Application.EnableEvents = True
Else
Selection.Font.FontStyle = "Standard"
Application.EnableEvents = True
End If
End Sub