Thema Datum  Von Nutzer Rating
Antwort
14.06.2011 08:41:53 Ingrid
NotSolved
14.06.2011 13:38:10 Till
NotSolved
Rot Selection aufheben
14.06.2011 13:59:09 Till
NotSolved
24.06.2011 09:13:48 Ingrid
NotSolved
25.06.2011 12:42:21 Till
NotSolved
25.06.2011 12:43:16 Till
NotSolved

Ansicht des Beitrags:
Von:
Till
Datum:
14.06.2011 13:59:09
Views:
1013
Rating: Antwort:
  Ja
Thema:
Selection aufheben

Ich habe deinen Code mal etwas vereinfacht (hoff ich). Müsste eigentlich soweit funktionieren, jedenfalls wenn du "<stronng>" wieder einsetzt. Weiß leider nicht wozu du das brauchst.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False

Dim strZelle As String

With Target
If .Row > 500 Then Exit Sub
If .Row < 8 Then Exit Sub
If .Column > 4 Then Exit Sub
End With

Select Case Target.Column
Case 2
    strZelle = "$B$" & CStr(Target.Row)
    With Target.EntireRow.Columns("B:H").Select
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="=" & strZelle & "<> """""
    .FormatConditions(1).Font
    .Bold = True
    .Italic = False
    .ColorIndex = 15
    End With
    
    Target.EntireRow.Columns("B").Select
    
    If Target = "" Then Exit Sub
    
    If Not IsDate(Target) Then Target = Date
    Target.Offset(0, 1) = ""
    Target.Offset(0, 2) = ""
 
Case 3
    strZelle = "$C$" & CStr(Target.Row)
    With Target.EntireRow.Columns("C:H")
    .FormatConditions.Delete
    'Beispiel für eine Formel, daß Zelle C NICHT leer ist
    .FormatConditions.Add Type:=xlExpression, Formula1:="=" & strZelle & "<> """""
    .FormatConditions(1).Font
    .Bold = True
    .Italic = False
    .ColorIndex = 3
    End With
    
    Target.EntireRow.Columns("C").Select

    If Target = "" Then Exit Sub
    
    If Not IsDate(Target) Then Target = Date
    Target.Offset(0, 1) = ""
    Target.Offset(0, -1) = ""
 
Case 4
    strZelle = "$D$" & CStr(Target.Row)
    With Target.EntireRow.Columns("D:H")
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="=" & strZelle & "<> """""
    .FormatConditions(1).Font
    .Bold = True
    .Italic = False
    .ColorIndex = 50
    End With
    
    Target.EntireRow.Columns("D").Select

    If Target = "" Then Exit Sub
    
    If Not IsDate(Target) Then Target = Date
    Target.Offset(0, -1) = ""
    Target.Offset(0, -2) = ""

End Select
Application.EnableEvents = True

End Sub

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
14.06.2011 08:41:53 Ingrid
NotSolved
14.06.2011 13:38:10 Till
NotSolved
Rot Selection aufheben
14.06.2011 13:59:09 Till
NotSolved
24.06.2011 09:13:48 Ingrid
NotSolved
25.06.2011 12:42:21 Till
NotSolved
25.06.2011 12:43:16 Till
NotSolved