Loop until underlined border??

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

Group,

I was wondering if coding a loop until a cell formatted
with an underline border is present is possible. and if so
what would be the syntax. Thanks in advance


Jeff

'''' Don't know what to put in the loop until name
''''X is the variable i cant figure out

Do
ActiveCell.Offset(1, 0).Select
loop until activecell.select = X
 
I turned on the macro recorder and used format =>Cells=>border to put a
border on the bottom of the active Cell. It recorded:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8/19/2004 by OGILVTW
'

'
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
End Sub


So you can possibly design a test around the parameters associated with
having a bottom border.
 
I would think it would also be the last cell so
x=cells(rows.count,"a").end(xlup).row

but this should do what you want
Sub findborder()
For Each c In Selection
If c.Borders(xlEdgeBottom).LineStyle = xlContinuous Then MsgBox c.Address
Next
End Sub
 
Try this:

Loop Until ActiveCell.Borders(xlEdgeBottom).LineStyle =
xlContinuous
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top