ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   count cells with diagonal borders (https://www.excelbanter.com/excel-programming/444937-count-cells-diagonal-borders.html)

jt

count cells with diagonal borders
 
i wish to count cells in a range that have diagonal cell borders or
the cell is X'd out, is it possible, thanks for any help

lifescholar

count cells with diagonal borders
 
On Sep 11, 4:00*am, jt wrote:
i wish to count cells in a range that have diagonal cell borders or
the cell is X'd out, is it possible, thanks for any help


Try the following UDF:

Function CountDiagonal(rng As Range)

Dim i As Integer
Dim cell As Range

i = 0

For Each cell In rng
If cell.Borders(xlDiagonalDown).LineStyle < xlLineStyleNone _
Or cell.Borders(xlDiagonalUp).LineStyle < xlLineStyleNone
Then
i = i + 1
End If
Next

CountDiagonal = i

End Function

Gord

count cells with diagonal borders
 
What do you mean by "X'd out"?

Post an example.


Gord Dibben Microsoft Excel MVP



On Sat, 10 Sep 2011 20:00:47 -0700 (PDT), jt
wrote:

i wish to count cells in a range that have diagonal cell borders or
the cell is X'd out, is it possible, thanks for any help


jt

count cells with diagonal borders
 
On Sep 11, 11:00*am, Gord wrote:
What do you mean by *"X'd out"?

Post an example.

Gord Dibben * *MicrosoftExcelMVP

On Sat, 10 Sep 2011 20:00:47 -0700 (PDT), jt
wrote:



i wish to count cells in a range that havediagonalcellbordersor
the cell is X'd out, is it possible, thanks for any help- Hide quoted text -


- Show quoted text -


excellent, this works, thankyou


All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com