"Find" findet nicht in Formel
06.01.2004 23:22:32
Franz W.
mit Hilfe von Lutz und Martin sind wir dran ein Problem zu lösen, es ist noch nicht gelöst, hat sich aber verändert. Darum wurde ich gebeten einen neuen Thread aufzumachen. Foldender Code findet das gesuchte Datum nicht, weil es nicht als Datum eingetragen ist, sondern in Form von Formeln vorliegt: A4 = A3 + 1:
Sub eintragen()
For e = 3 To ziel
On Error Resume Next
Set x = Sheets("Kalender").Range("A3:DP33").Find(termf(e)) ' Finde Feiertag...
t = x.Row
m = x.Column
If Not Cells(t, m).Comment Is Nothing Then Cells(t, m).Comment.Delete
If Not Cells(t, m) = 0 Then
Set cmt = Cells(t, m).AddComment _
(Text:=Chr(10) & " " & feiert(e) & " " & Chr(10) & " ")
With cmt.Shape
.TextFrame.AutoSize = True
.Fill.ForeColor.SchemeColor = 10
.TextFrame.Characters.Font.Size = 8
.TextFrame.Characters.Font.ColorIndex = 2
.TextFrame.Characters.Font.Bold = True
End With
End If
Next e
End Sub
Das Ganze um eine dreifach verschachtelte For-Next-Schleife zu vereinfachen. Wer sich beide Alternativen anschauen möchte, hier eine Beispieldatei:
https://www.herber.de/bbs/user/2795.xls
Das Makro steht im Modul "Eintragungen".
Vielen Dank im Voraus und Grüße
Franz