Test if cell has diagonal borders

G

Guest

Thanks for taking the time to read my question.

I want to test if a cell has diagonal borders. How do I do this?

I tried:

If Range("C5").Borders(xlDiagonalDown) = True Then
MsgBox "Yes"
End If

but it didn't work.

Thanks for your help.

Brad
 
G

Guest

If Range("C5").Borders(xlDiagonalDown).LineStyle <> xlNone Then
MsgBox "Yes"
End If

If Range("C5").Borders(xlDiagonalUp).LineStyle <> xlNone Then
MsgBox "Yes"
End If

HTH,
 
G

Guest

Of course!

Thanks so much,

Brad

Gary L Brown said:
If Range("C5").Borders(xlDiagonalDown).LineStyle <> xlNone Then
MsgBox "Yes"
End If

If Range("C5").Borders(xlDiagonalUp).LineStyle <> xlNone Then
MsgBox "Yes"
End If

HTH,
--
Gary Brown
gary_brown@ge_NOSPAM.com
If this post was helpful, please click the ''''Yes'''' button next to
''''Was this Post Helpfull to you?".
 
G

Guest

Hi Gary,

Can I do this? It's not working for me.

do until Cells(x, a).Border(xlDiagonalDown).LineStyle <> xlNone

something here

loop

Brad
 

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

Top