Thema Datum  Von Nutzer Rating
Antwort
Rot Selection aufheben
14.06.2011 08:41:53 Ingrid
NotSolved
14.06.2011 13:38:10 Till
NotSolved
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:
Ingrid
Datum:
14.06.2011 08:41:53
Views:
2441
Rating: Antwort:
  Ja
Thema:
Selection aufheben
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Hallo zusammen!
Der nachfolgende Code läuft einwandfrei, zur kurzen Erklärung: Wird in Spalte B,C oder D ein Zeichen gesetzt, wird automatisch
das aktuelle Datum vermerkt. Wird in Spalte B ein Zeichen gesetzt färbt sich zusätzlich die komplette Zeile grau, in Spalte C färbt sich
die Zeile rot und in Spalte D grün.
 
Das einzige Problem ist der "Select"-Befehl. Klicke ich z.B. auf "B12", setze irgendein Zeichen -> und möchte dann anschließend
mit der Maus sofort zu "D20" wechseln muss man immer 2mal in die Zelle klicken, weil zuvor nochmal B markiert wurde.
Der Befehl, der dafür verantwortlich ist, ist wahrscheinlich "<strong>Target.EntireRow.Columns("B").Select</strong>", weiß aber nicht was
ich sonst schreiben soll?! Kann mir jemand weiterhelfen?
 
Danke schon mal!!
 
 
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strZelle As String
If Target.Row > 500 Then Exit Sub
If Target.Row < 8 Then Exit Sub
If Target.Column > 4 Then Exit Sub
 
If Target.Column = 2 Then
If Target.Column = 2 Then
    strZelle = "$B$" & CStr(Target.Row)
    Target.EntireRow.Columns("B:H").Select
    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=" & strZelle & "<> """""
    With Selection.FormatConditions(1).Font
        .Bold = True
        .Italic = False
        .ColorIndex = 15
    End With
        <strong>Target.EntireRow.Columns("B").Select
</strong>    End If
If Target = "" Then Exit Sub
Application.EnableEvents = False
If Not IsDate(Target) Then Target = Date
Target.Offset(0, 1) = ""
Target.Offset(0, 2) = ""
 
ElseIf Target.Column = 3 Then
If Target.Column = 3 Then
    strZelle = "$C$" & CStr(Target.Row)
    Target.EntireRow.Columns("C:H").Select
    Selection.FormatConditions.Delete
    'Beispiel für eine Formel, daß Zelle C NICHT leer ist
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=" & strZelle & "<> """""
    With Selection.FormatConditions(1).Font
        .Bold = True
        .Italic = False
        .ColorIndex = 3
    End With
        <strong>Target.EntireRow.Columns("C").Select
</strong>End If
If Target = "" Then Exit Sub
Application.EnableEvents = False
If Not IsDate(Target) Then Target = Date
Target.Offset(0, 1) = ""
Target.Offset(0, -1) = ""
 
ElseIf Target.Column = 4 Then
If Target.Column = 4 Then
    strZelle = "$D$" & CStr(Target.Row)
    Target.EntireRow.Columns("D:H").Select
    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=" & strZelle & "<> """""
    With Selection.FormatConditions(1).Font
        .Bold = True
        .Italic = False
        .ColorIndex = 50
    End With
<strong>        Target.EntireRow.Columns("D").Select
</strong>End If
If Target = "" Then Exit Sub
Application.EnableEvents = False
If Not IsDate(Target) Then Target = Date
Target.Offset(0, -1) = ""
Target.Offset(0, -2) = ""
End If
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
Rot Selection aufheben
14.06.2011 08:41:53 Ingrid
NotSolved
14.06.2011 13:38:10 Till
NotSolved
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