Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Complete VBA noob.
I have created a module in VBA and have tried the following to count cells in a range on one sheet that have four sides bordered and have the count results in a cell on another sheet. Line style and color do not matter. Function CountBrd(rng As Range) Dim i As Integer Dim cell As Range i = 0 For Each cell In rng If cell.Borders(xlEdgeLeft).LineStyle < xlLineStyleNone AndIf cell.Borders(xlEdgeRight).LineStyle < xlLineStyleNone AndIf cell.Borders(xlEdgeBottom).LineStyle < xlLineStyleNone AndIf cell.Borders(xlEdgeTop).LineStyle < xlLineStyleNone Then i = i + 1 End If Next CountBrd = i End Function On another sheet in a cell I have =CountBrd("Sheetname""Range") I get a couple of syntax errors and since I know zero about this I come to you for help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting the number of cells between 2 seperate cells | Excel Discussion (Misc queries) | |||
Query counting cells in a row that exactly match cells in another | Excel Discussion (Misc queries) | |||
Complicated counting of cells (based on other cells contents) | Excel Worksheet Functions | |||
Counting empty cells within a range of cells | New Users to Excel | |||
Counting empty cells within a range of cells | New Users to Excel |