Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
984to988
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
984to988
984to988
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Vergleich Spalten mit Markierung

Vergleich Spalten mit Markierung
20.06.2008 10:37:24
Andreas
Hallo,
ich benötige für folgendes Problem ein Makro:
Es sollen alle Zellen in der Spalte C (Format: Text) ab der zweiten Zeile mit allen Zellen in der Spalte H (Format: Text) ab der zweiten Zeile verglichen werden.
1. Wenn die Zelle aus Spalte C nicht identisch mit dem Zellinhalt der Spalte H ist, soll die entsprechende Zelle in Spalte C markiert werden.
2. Desweiteren muß die zweite Bedingung geprüft werden:
Wenn die Inhalte identisch sind (z.B. C3 = H16), soll die zur Spalte C gehörige Zelle in Spalte E (dann E3 mit der entsprechenden Zelle in Spalte J (dann J16) verglichen werden. Die Spalten E und J haben das Format Datum.
Wenn die Zellen der Spalte E (hier E3) und Spalte J (hier J16) nicht identisch sind, soll die zugehörige Zelle in Spalte C (hier C3) markiert werden.
Ich hoffe die Erklärung ist nachvollziehbar.
Gruß Andreas

7
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Bahnhof?
20.06.2008 15:59:46
Klaus
  • Ich hoffe die Erklärung ist nachvollziehbar.

  • Nein, leider nicht. Beispieldatei?
    Grüße,
    Klaus M.vdT.

    AW: Bahnhof?
    20.06.2008 18:35:00
    jockel
    hi Andreas, meinst du vielleicht so:
    Tabelle1

     ABCDEFGHIJ
    1VornameNachnameKundennr.AnfangEnde  Kundennr.AnfangEnde
    2N.NN.N.P99912345601.10.200831.10.2008  P99912346510.10.200809.11.2008
    3N.NN.N.P99912345702.10.200801.11.2008  P99912346611.10.200810.11.2008
    4N.NN.N.P99912345803.10.200802.11.2008  P99912346712.10.200811.11.2008
    5N.NN.N.P99912345904.10.200803.11.2008  P99912346813.10.200812.11.2008
    6N.NN.N.P99912346005.10.200804.11.2008  P99912346914.10.200813.11.2008
    7N.NN.N.P99912346106.10.200805.11.2008  P99912347015.10.200814.11.2008
    8N.NN.N.P99912346207.10.200806.11.2008  P99912347116.10.200815.11.2008
    9N.NN.N.P99912346308.10.200807.11.2008  P99912347217.10.200816.11.2008
    10N.NN.N.P99912346409.10.200808.11.2008  P99912347318.10.200817.11.2008
    11N.NN.N.P99912346510.10.200809.11.2008  P99912347419.10.200818.11.2008
    12N.NN.N.P99912346611.10.200810.11.2008  P99912347520.10.200819.11.2008
    13N.NN.N.P99912346712.10.200811.11.2008  P99912347621.10.200820.11.2008
    14N.NN.N.P99912346813.10.200812.11.2008  P99912347722.10.200821.11.2008
    15N.NN.N.P99912346914.10.200813.11.2008  P99912345601.10.200831.10.2008
    16N.NN.N.P99912347015.10.200814.11.2008  P99912345701.12.200831.12.2008
    17N.NN.N.P99912347116.10.200815.11.2008  P99912345803.10.200802.11.2008
    18N.NN.N.P99912347217.10.200816.11.2008  P99912345904.10.200803.11.2008
    19N.NN.N.P99912347318.10.200817.11.2008  P99912346005.10.200804.11.2008
    20          
    21          
    22          
    23 Kundennummer markiert, da Datensätze im rechten Bereich fehlen        
    24          
    25 Kundennummer markiert, da bei gleicher Kundennumer Endedatum unterschiedlich        

    Bedingte Formatierungen der Tabelle
    ZelleNr.: / BedingungFormat
    C21. / Formel ist =ZÄHLENWENN($H$2:$H$19;C2)=0Abc
    C22. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C2)*($J$2:$J$19<>E2))Abc
    C31. / Formel ist =ZÄHLENWENN($H$2:$H$19;C3)=0Abc
    C32. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C3)*($J$2:$J$19<>E3))Abc
    C41. / Formel ist =ZÄHLENWENN($H$2:$H$19;C4)=0Abc
    C42. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C4)*($J$2:$J$19<>E4))Abc
    C51. / Formel ist =ZÄHLENWENN($H$2:$H$19;C5)=0Abc
    C52. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C5)*($J$2:$J$19<>E5))Abc
    C61. / Formel ist =ZÄHLENWENN($H$2:$H$19;C6)=0Abc
    C62. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C6)*($J$2:$J$19<>E6))Abc
    C71. / Formel ist =ZÄHLENWENN($H$2:$H$19;C7)=0Abc
    C72. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C7)*($J$2:$J$19<>E7))Abc
    C81. / Formel ist =ZÄHLENWENN($H$2:$H$19;C8)=0Abc
    C82. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C8)*($J$2:$J$19<>E8))Abc
    C91. / Formel ist =ZÄHLENWENN($H$2:$H$19;C9)=0Abc
    C92. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C9)*($J$2:$J$19<>E9))Abc
    C101. / Formel ist =ZÄHLENWENN($H$2:$H$19;C10)=0Abc
    C102. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C10)*($J$2:$J$19<>E10))Abc
    C111. / Formel ist =ZÄHLENWENN($H$2:$H$19;C11)=0Abc
    C112. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C11)*($J$2:$J$19<>E11))Abc
    C121. / Formel ist =ZÄHLENWENN($H$2:$H$19;C12)=0Abc
    C122. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C12)*($J$2:$J$19<>E12))Abc
    C131. / Formel ist =ZÄHLENWENN($H$2:$H$19;C13)=0Abc
    C132. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C13)*($J$2:$J$19<>E13))Abc
    C141. / Formel ist =ZÄHLENWENN($H$2:$H$19;C14)=0Abc
    C142. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C14)*($J$2:$J$19<>E14))Abc
    C151. / Formel ist =ZÄHLENWENN($H$2:$H$19;C15)=0Abc
    C152. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C15)*($J$2:$J$19<>E15))Abc
    C161. / Formel ist =ZÄHLENWENN($H$2:$H$19;C16)=0Abc
    C162. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C16)*($J$2:$J$19<>E16))Abc
    C171. / Formel ist =ZÄHLENWENN($H$2:$H$19;C17)=0Abc
    C172. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C17)*($J$2:$J$19<>E17))Abc
    C181. / Formel ist =ZÄHLENWENN($H$2:$H$19;C18)=0Abc
    C182. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C18)*($J$2:$J$19<>E18))Abc
    C191. / Formel ist =ZÄHLENWENN($H$2:$H$19;C19)=0Abc
    C192. / Formel ist =SUMMENPRODUKT(($H$2:$H$19=C19)*($J$2:$J$19<>E19))Abc


    Excel Tabellen im Web darstellen >> Excel Jeanie HTML 4
    cu jörg
    ein feedback wär ganz reizend

    Anzeige
    AW: Bahnhof?
    21.06.2008 17:48:00
    Andreas
    Hallo Jörg,
    danke für Deine Hilfe, aber ich benötige ein Makro in VBA, da das Beispiel nur ein Muster war.
    Hier habe ich nur das Hauptproblem beschrieben.
    Das Makro wird auch noch um andere Aktionen ergänzt.
    Gruß Andreas

    AW: Bahnhof?
    23.06.2008 15:09:00
    Andreas
    Hallo,
    habe mittlwerweile die erste Abfrage als Makro umgesetzt.
    Sub Zellen_vergleichen() Dim lngI As Long Dim intWert1 As Integer Application.ScreenUpdating = False For lngI = 2 To Cells(Rows.Count, 3).End(xlUp).Row intWert1 = Application.WorksheetFunction.CountIf(Worksheets("Tabelle1").Range("H2:H10000"), _ Cells(lngI, 3).Value) If intWert1 = 0 Then Cells(lngI, 3).Interior.ColorIndex = 3 End If Next lngI Application.ScreenUpdating = True End Sub


    Es fehlt jetzt nur die Abfrage, wenn die Kundennummer gleich ist, aber das Endedatum ungleich ist => dann soll die Kundenummer in Spalte C ebenfalls markiert werden.
    Gruß Andreas

    Anzeige
    AW: Vergleich Spalten mit Markierung
    26.06.2008 20:55:20
    Gerd
    Hallo Andreas!
    
    Sub Zellen_vergleichen()
    Dim Ws As Worksheet
    Dim Suchbereich As Range
    Dim lngI As Long
    Application.ScreenUpdating = False
    Set Ws = ThisWorkbook.Worksheets("Tabelle1")
    With Ws
    Set Suchbereich = .Range(.Cells(1, 8), .Cells(Rows.Count, 8).End(xlUp))
    For lngI = 2 To Cells(Rows.Count, 3).End(xlUp).Row
    If Application.WorksheetFunction.CountIf(Suchbereich, .Cells(lngI, 3).Value) = 0 Then
    .Cells(lngI, 3).Interior.Color = vbYellow
    ElseIf Ws.Cells(Application.Match(Ws.Cells(lngI, 3).Value, Suchbereich, 0), 10).Value  _
    Ws.Cells(lngI, 5).Value Then .Cells(lngI, 3).Interior.Color = vbBlue
    End If
    Next lngI
    End With
    Application.ScreenUpdating = True
    End Sub
    


    Gruß Gerd

    Anzeige
    AW: Vergleich Spalten mit Markierung
    27.06.2008 10:41:00
    Andreas
    Hallo Gerd,
    besten Dank für Deine Hilfe.
    Gruß Andreas

    Beliebteste Forumthreads (12 Monate)

    Anzeige

    Beliebteste Forumthreads (12 Monate)

    Anzeige
    Anzeige
    Anzeige