Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() wrote in message ... 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. Another one, based on Claus' but could be a few times faster be faster with a large range Function CountBordersAround(rng As Range) As Long Dim n As Long Dim c As Range n = rng.Count For Each c In rng For i = xlEdgeLeft To xlEdgeRight If c.Borders(i).LineStyle = xlNone Then n = n - 1 Exit For End If Next Next CountBordersAround = n End Function Regards, Peter T |
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 |