![]() |
#1
|
|||
|
|||
![]() I use a spread sheet that will have several hundred data entry areas between the line boarders that I create for each data entry area. Each data entry area may use one line, two lines and up to five lines between the boarders that create (define) the data areas. I need to know how many separate data entry areas there are (the area between the boarders that may use one to five lines) in the spread sheet. So I currently count (sum) them manually. Is there a way to automate the count (sum) of the data areas? Last edited by tdody; 08-13-2015 at 09:07 AM. |
#2
|
||||
|
||||
![]()
Hi
perhaps post a sample sheet ? ( no pics please)
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
|||
|
|||
![]()
Sample file attached. Imagine this spread sheet using 300 lines total. I want to be able to quickly determine the number of groups between the line boarders rather than the number of lines used. Thanks
|
#4
|
||||
|
||||
![]()
I'm afraid this can't be done with formula. I'll transfer the thread to VBA forum
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#5
|
|||
|
|||
![]()
Hello tdody,
I added the following macro to your file and saved it as a macro enabled .xlsm file. I believe Office 2007 and newer install by default with macros disabled and no notification letting you know. If your Excel is still like that this won't work without adjustments in the Trust Center. Here's a couple of links if you need guidance concerning this. http://www.addictivetips.com/windows...in-excel-2010/ https://support.office.com/en-nz/art...1-9efe4f860b12 Alt + F8 will bring up the Macro Dialogue. Click Count_The_Areas and hit Run. Code:
Sub Count_The_Areas() Dim rng As Range Dim cel As Range Dim lastrow As Long Dim i As Long With ActiveSheet 'find last used row lastrow = .Cells.Find("*", .Cells(1, 1), , , xlByRows, xlPrevious).Row 'set the range to look at Set rng = .Range("A1:A" & lastrow) 'look at the individual cells in that range For Each cel In rng 'check the cell for a line formatted to the bottom of the cell If Not cel.Borders(xlEdgeBottom).LineStyle = xlNone Then 'that means it does have a bottom line, so add to i i = i + 1 End If Next cel MsgBox "There are " & i & " areas between borders." End With End Sub |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Showing page numer and total page count in TOC | Ulodesk | Word | 5 | 02-12-2014 01:03 PM |
![]() |
uhlersa | Word | 1 | 05-07-2012 03:34 PM |
spacing marked the areas in red for all to see | bobafet | Word | 0 | 07-08-2010 12:40 PM |
Defining Printable Areas | OfficeUser00939 | Word | 5 | 06-29-2009 09:04 AM |