Thema Datum  Von Nutzer Rating
Antwort
24.04.2014 12:40:58 Corina
NotSolved
24.04.2014 17:08:01 Corina
NotSolved
24.04.2014 21:43:02 gabi
NotSolved
Blau Vgl. Zelleneinträge mit ShapeText
25.04.2014 10:21:14 Corina
NotSolved
25.04.2014 13:44:03 Gast25327
*****
Solved
25.04.2014 13:50:37 Gast63045
NotSolved
25.04.2014 16:07:24 Corina
NotSolved
25.04.2014 16:25:04 Corina
NotSolved
25.04.2014 23:00:38 gabi
NotSolved
26.04.2014 09:50:55 gabi
*****
Solved
27.04.2014 13:20:34 Corina
NotSolved
27.04.2014 18:40:31 gabi
NotSolved
28.04.2014 08:46:31 Corina
NotSolved
Blau Wow
28.04.2014 09:24:53 gabi
NotSolved
Rot Wow
28.04.2014 12:51:17 Corina
NotSolved
Blau Wow
28.04.2014 15:29:14 gabi
NotSolved
Rot Wow
29.04.2014 09:55:11 Corina
NotSolved
29.04.2014 12:15:23 gabi
NotSolved
28.04.2014 13:46:57 Gast40414
NotSolved
28.04.2014 14:29:04 Corina
NotSolved
28.04.2014 15:02:35 Gast13316
NotSolved
28.04.2014 15:06:49 Gast54937
NotSolved
28.04.2014 15:31:48 Corina
NotSolved
28.04.2014 14:37:59 Corina
NotSolved
27.04.2014 12:50:26 Corina
NotSolved

Ansicht des Beitrags:
Von:
Corina
Datum:
25.04.2014 10:21:14
Views:
1745
Rating: Antwort:
  Ja
Thema:
Vgl. Zelleneinträge mit ShapeText

Hallo Gabi,

vielen Dank für deine Nachricht... Ich muss mir leider eingestehen, dass mir das Abstraktionsvermögen fehlt, welches wohl erforderlich ist um einen gescheiden Code zu schreiben. Ich versuche immer mein Anliegen in Teilschritte zu zerlegen, aber es kommt nicht viel dabei rum.

Dennoch bin vor Glück beinahe den Tränen nahe, weil ich nun wenigstens einen Code hier posten kann, der wenigstens halbwegs funktioniert :D Er produziert zwar einige falsche Ergebnisse, aber er läuft! Here goes:

Sub Test()
Dim ws As Worksheet
Dim lastRow As Long
Dim SrchRng As Range
Dim c As Range
Dim Found As Boolean
Dim shp As Excel.Shape
Dim myText As Variant
Dim Count As Long
Dim AllCells() As Variant
Dim i As Long

On Error GoTo ErrHandler

Set ws = Worksheets("Lists")
lastRow = ws.Cells(Rows.Count, 1).End(xlUp).row
Set SrchRng = ws.Range("D2:G" & lastRow)

For Each c In SrchRng.Cells
    Found = False
    If c <> "" Then
        For Each shp In Worksheets("Checklist Structure").Shapes
            If shp.Type = msoShapeRoundedRectangle Then
                myText = shp.TextFrame2.TextRange.Characters.Text
                If c.Value = myText Then
                Found = True
                Exit For
                End If
            End If
        Next shp

        If Found = False Then
        Count = Count + 1
        ReDim Preserve AllCells(1 To Count)
        AllCells(Count) = c.Value
        End If
    End If
Next c
For i = LBound(AllCells) To UBound(AllCells)
MsgBox "Shape with text " & AllCells(i) & " is missing."
Next i

Exit Sub
  
ErrHandler:
Call MsgBox(Err.Description, vbCritical, "Fehler " & Err.number)

End Sub

Ich bleibe dran! ;) Allerdings muss ich fairerweise gestehen, dass der letzte Part (ab "If Found") nicht von mir ist... Und dass ich den Teil vorher auf die Reihe bekommen habe, ist das Ergebnis eines mühevollen "Trial and Error" - Prozesses...

Viele Grüße

Corina


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
24.04.2014 12:40:58 Corina
NotSolved
24.04.2014 17:08:01 Corina
NotSolved
24.04.2014 21:43:02 gabi
NotSolved
Blau Vgl. Zelleneinträge mit ShapeText
25.04.2014 10:21:14 Corina
NotSolved
25.04.2014 13:44:03 Gast25327
*****
Solved
25.04.2014 13:50:37 Gast63045
NotSolved
25.04.2014 16:07:24 Corina
NotSolved
25.04.2014 16:25:04 Corina
NotSolved
25.04.2014 23:00:38 gabi
NotSolved
26.04.2014 09:50:55 gabi
*****
Solved
27.04.2014 13:20:34 Corina
NotSolved
27.04.2014 18:40:31 gabi
NotSolved
28.04.2014 08:46:31 Corina
NotSolved
Blau Wow
28.04.2014 09:24:53 gabi
NotSolved
Rot Wow
28.04.2014 12:51:17 Corina
NotSolved
Blau Wow
28.04.2014 15:29:14 gabi
NotSolved
Rot Wow
29.04.2014 09:55:11 Corina
NotSolved
29.04.2014 12:15:23 gabi
NotSolved
28.04.2014 13:46:57 Gast40414
NotSolved
28.04.2014 14:29:04 Corina
NotSolved
28.04.2014 15:02:35 Gast13316
NotSolved
28.04.2014 15:06:49 Gast54937
NotSolved
28.04.2014 15:31:48 Corina
NotSolved
28.04.2014 14:37:59 Corina
NotSolved
27.04.2014 12:50:26 Corina
NotSolved