Hallo,
ich möchte einen Bereich nach einer Zelle mit einem Unterstrich durchsuchen
Folgende Prozedur bringt jedoch nicht das gewünschte Ergebnis. Suche ich nach einem FontStyle funktioniert der Code jedoch, nicht jedoch für LineStyles.
In Excel selbst funktioniert die Suche, durch Application.FindFormat.Clear wird jedoch die Eingabe durch Excel gelöscht.
Sub FindLineStyle()
Dim rg As Range
Range("A4").Select
Debug.Print "LineStyle before set = " & Range("A4").Borders(xlEdgeBottom).LineStyle
Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous
Debug.Print "LineStyle after set = " & Range("A4").Borders(xlEdgeBottom).LineStyle
Application.FindFormat.Clear
Range("A1:A9").Select
Application.FindFormat.Borders(xlEdgeBottom).LineStyle = xlContinuous
Set rg = Selection.Find(What:="", SearchFormat:=True)
If Not rg Is Nothing Then
Debug.Print rg.row
Else
Debug.Print "LineStyle after search = " & Range("A4").Borders(xlEdgeBottom).LineStyle
End If
Range("A4").Borders(xlEdgeBottom).LineStyle = xlLineStyleNone
Debug.Print vbCrLf
End Sub
Vielen Dank im Voraus.
Gruß Holger
|