|  
                                             
	Moin,  
	habe ein Makro in VBA geschrieben um bestimmte Zeichen in meinen Zellen zu färben, es geht darum die Zeichen d,s,c,h zu färben plus das Zeichen was davor steht. 
	Folgende Formel habe ich bereits erstellt; 
	  
	  
	Sub Färben() 
	    Dim Wort$, Pos% 
	    Dim n As Integer 
	    For n = 2 To 112 
	    Wort = ThisWorkbook.Worksheets("SB").Cells(n, 1) 'Beispiel steht in A1 
	    Pos = InStr(Wort, "h") 
	    If Pos > 0 Then 
	    With ThisWorkbook.Worksheets("SB").Cells(n, 1).Characters(Start:=Pos - 1, Length:=2).Font 
	        .Name = "Arial" 
	        .Size = 14 
	        .ColorIndex = 3 'rot 
	    End With 
	    End If 
	  
	    
	    Wort = ThisWorkbook.Worksheets("SB").Cells(n, 1) 'Beispiel steht in A1 
	    Pos = InStr(Wort, "s") 
	    If Pos > 0 Then 
	    With ThisWorkbook.Worksheets("SB").Cells(n, 1).Characters(Start:=Pos - 1, Length:=2).Font 
	       .Name = "Arial" 
	        .Size = 14 
	        .ColorIndex = 1 'schwarz 
	    End With 
	    End If 
	  
	    Wort = ThisWorkbook.Worksheets("SB").Cells(n, 1) 'Beispiel steht in A1 
	    Pos = InStr(Wort, "d") 
	    If Pos > 0 Then 
	    With ThisWorkbook.Worksheets("SB").Cells(n, 1).Characters(Start:=Pos - 1, Length:=2).Font 
	        .Name = "Arial" 
	        .Size = 14 
	        .ColorIndex = 5 'blau 
	    End With 
	    End If 
	     
	    Wort = ThisWorkbook.Worksheets("SB").Cells(n, 1) 'Beispiel steht in A1 
	    Pos = InStr(Wort, "c") 
	    If Pos > 0 Then 
	    With ThisWorkbook.Worksheets("SB").Cells(n, 1).Characters(Start:=Pos - 1, Length:=2).Font 
	        .Name = "Arial" 
	        .Size = 14 
	        .ColorIndex = 10 'grün 
	    End With 
	    End If 
	    Next n 
	End Sub 
	  
	Diese Formel funktioniert auch wunderbar, außer wenn ein bestimmtes Zeichen z.B. "d" mehrfach in einer Zeile vorkommt. Dann wird nur das erste "d" plus das Vorzeichen gefärbt ader kein weiteres d. 
	  
	Ein Beispiel: 
	  
	Zelle A11 = 7d9d2s, 7d wird blau angezigt(korrekt) 9d wird schwarz gezeigt (falsch, sollte blau sein) und 2s wird schwarz gezeigt(korrekt) 
	  
	Danke im Vorraus 
	  
     |