ich möchte mit vba den Zelltext prüfen, das dritte Zeichen und siebte Zeichen einer Zelle sollte ein Punkt sein wenn nicht Zell Hintergrund rot.
mfg
Harald
=NICHT(UND(TEIL(A1;3;1)=".";TEIL(A1;7;1)="."))
Greetz Renee
Sub RedOctober()
Dim lRow As Long
Dim lCol As Long
lRow = 1 ' Zeilen- und
lCol = 1 ' Spalten-Index entsprechend anpassen
If Mid(Cells(lRow, lCol), 3, 1) = "." And Mid(Cells(lRow, lCol), 7, 1) = "." Then
Cells(lRow, lCol).Interior.ColorIndex = xlColorIndexNone
Else
Cells(lRow, lCol).Interior.ColorIndex = 3
End If
End Sub
Greetz Renee
Sub RedOctober()
Dim rC As Range
ActiveSheet.Range("B:B").Cells.Interior.ColorIndex = 3
For Each rC In ActiveSheet.Range("B:B").Cells
If Len(rC) > 6 Then
If Mid(rC, 3, 1) = "." And Mid(rC, 7, 1) = "." Then rC.Interior.ColorIndex = _
xlColorIndexNone
End If
Next
End Sub
Greetz Renee
Option Explicit
Sub RedOctober()
Dim rC As Range
Application.ScreenUpdating = False
ActiveSheet.Range("B:B").Cells.Interior.ColorIndex = 3
For Each rC In ActiveSheet.Range("B:B").Cells
If Len(rC) > 6 Then
If Mid(rC, 3, 1) = "." And Mid(rC, 7, 1) = "." Then _
rC.Interior.ColorIndex = xlColorIndexNone
End If
Next
Application.ScreenUpdating = True
End Sub