Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2015, 06:58 AM
tdody tdody is offline Count numer of areas between boarders Windows 8 Count numer of areas between boarders Office 2007
Novice
Count numer of areas between boarders
 
Join Date: Aug 2015
Posts: 2
tdody is on a distinguished road
Default Count numer of areas between boarders

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.
Reply With Quote
  #2  
Old 08-13-2015, 08:12 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Count numer of areas between boarders Windows 7 64bit Count numer of areas between boarders Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,943
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

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
Reply With Quote
  #3  
Old 08-13-2015, 09:19 AM
tdody tdody is offline Count numer of areas between boarders Windows 8 Count numer of areas between boarders Office 2007
Novice
Count numer of areas between boarders
 
Join Date: Aug 2015
Posts: 2
tdody is on a distinguished road
Default

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
Attached Files
File Type: xlsx TEST Spread Sheet.xlsx (10.2 KB, 12 views)
Reply With Quote
  #4  
Old 08-13-2015, 11:32 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Count numer of areas between boarders Windows 7 64bit Count numer of areas between boarders Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,943
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

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
Reply With Quote
  #5  
Old 08-13-2015, 01:02 PM
NoSparks NoSparks is offline Count numer of areas between boarders Windows 7 64bit Count numer of areas between boarders Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

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
Attached Files
File Type: xlsm TEST Spread Sheet.xlsm (19.6 KB, 8 views)
Reply With Quote
Reply



Similar Threads
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
Count numer of areas between boarders word 2007 grayed out areas 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft