![]() |
Test if cell has diagonal borders
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 |
Test if cell has diagonal borders
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 If this post was helpful, please click the ''''Yes'''' button next to ''''Was this Post Helpfull to you?". "Brad" wrote: 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 |
Test if cell has diagonal borders
Of course!
Thanks so much, Brad "Gary L Brown" wrote: 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 If this post was helpful, please click the ''''Yes'''' button next to ''''Was this Post Helpfull to you?". "Brad" wrote: 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 |
Test if cell has diagonal borders
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 "Gary L Brown" wrote: 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 If this post was helpful, please click the ''''Yes'''' button next to ''''Was this Post Helpfull to you?". "Brad" wrote: 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 |
All times are GMT +1. The time now is 06:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com