[RESOLVED] Searching for a bottom border of a particular color
How would one search a column for the first occurrence of a cell that had a bottom border of a particular ColorIndex?
I've been Googling and Googling, and I can't find the answer to this question.
Many thanks!
Re: Searching for a bottom border of a particular color
Quick sample...
Simple looping through rows in the column
test for ColorIndex of Borders(xlEdgeBottom)
Code:
Dim lLoopIndex As Long
Application.StatusBar = "Searching for Bottom BorderColor"
DoEvents
Application.ScreenUpdating = False 'Stop Excel showing the selecting of each cell
For lLoopIndex = 1 To 32767 '<-- You did not say how far down the column that you wanted to search!
Cells(lLoopIndex, ActiveCell.Column).Select
If Selection.Borders(xlEdgeBottom).ColorIndex = 4 Then
Stop
End If
Next
Application.ScreenUpdating = True
Debug.Print "Searched to " & lLoopIndex
Application.StatusBar = "Search Complete"
DoEvents
you might want to set a var to the current cell and then select that cell when done searching.