Syntax

expression.Borders

expression A variable that represents a CellFormat object.

Example

This example sets the search criteria to identify the borders of cells that have a continuous and thick style bottom-edge, creates a cell with this condition, finds this cell, and notifies the user.

Note
The default color of the border is used in this example, therefore the color index is not changed.
Visual Basic for Applications
Sub SearchCellFormat() ' Set the search criteria for the border of the cell format. With Application.FindFormat.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThick End With ' Create a continuous thick bottom-edge border for cell A5. Range("A5").Select With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThick End With Range("A1").Select MsgBox "Cell A5 has a continuous thick bottom-edge border" ' Find the cells based on the search criteria. Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _ xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _, SearchFormat:=True).Activate MsgBox "Microsoft Excel has found this cell matching the search criteria." End Sub

See also: