J jt Sep 11, 2011 #1 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
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
L lifescholar Sep 11, 2011 #2 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 Click to expand... 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
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 Click to expand... 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
G Gord Sep 11, 2011 #3 What do you mean by "X'd out"? Post an example. Gord Dibben Microsoft Excel MVP
J jt Sep 26, 2011 #4 What do you mean by "X'd out"? Post an example. Gord Dibben MicrosoftExcelMVP - Show quoted text - Click to expand... excellent, this works, thankyou
What do you mean by "X'd out"? Post an example. Gord Dibben MicrosoftExcelMVP - Show quoted text - Click to expand... excellent, this works, thankyou