I'd like to find the last row that contains any one of the following things:
- Text
- Interior color
- Borders
This construct:
Code:
with wks
lastRow = .Columns(col).Find("*", SearchOrder:=xlByRows, _
LookIn:=xlValues, SearchDirection:=xlPrevious).row
end with
seems to only find text. I can accomplish my goal by looping over each cell in the column, something like (untested):
Code:
Dim i as integer
with wks
for i = 65535 to 1 step -1
if not isEmpty(.cells(i,col)) and .cells(i,col).interior.colorIndex <> xlNone then _
exit for
next i
end with
msgbox("Last row with anything is " + str(i))
I don't know how to tell if there's a border, but in principle I can Google for it, and if I can't find it, ask here, and use it as a third condition in the conditional.
If there a faster or shorter way of doing this?
Thanks!