VBA Areas

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,180
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I have a set of data that was given to me about 100000 rows like below. What I need to do is to count the areas but I can't figure it out. Any help would be appreciated!
<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC ;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC ;
}
.tableizer-table th {
background-color: #104E8B ;
color: #FFF ;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th>1111</th><th>aaaaaaa</th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th> </th><th>Count Needed</th></tr></thead><tbody>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>11/14/2017</td><td>7/1/2018</td><td>CUR</td><td>0</td><td>116311</td><td>10</td><td> </td><td>2</td></tr>
<tr><td> </td><td> </td><td>8/31/2017</td><td>11/14/2017</td><td>RE</td><td>0</td><td>116211</td><td>10</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>22222</td><td>bbbbbbb</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>2/2/2018</td><td>7/1/2018</td><td>CUR</td><td>0</td><td>116311</td><td>10</td><td> </td><td>2</td></tr>
<tr><td> </td><td> </td><td>8/31/2017</td><td>2/2/2018</td><td>RE</td><td>0</td><td>110811</td><td>10</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>33333</td><td>ccccccccc</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>1/23/2018</td><td>7/1/2018</td><td>CUR</td><td>0</td><td>116211</td><td>9</td><td> </td><td>4</td></tr>
<tr><td> </td><td> </td><td>12/13/2017</td><td>1/23/2018</td><td>RE</td><td>0</td><td>901</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>8/31/2017</td><td>12/13/2017</td><td>RE</td><td>0</td><td>116211</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>12/13/2017</td><td>1/23/2018</td><td>RE</td><td>0</td><td>901</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>444444</td><td>ddddddd</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td>8</td></tr>
<tr><td> </td><td> </td><td>12/13/2017</td><td>7/1/2018</td><td>CUR</td><td>0</td><td>901</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>8/31/2017</td><td>12/13/2017</td><td>RE</td><td>0</td><td>116211</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>12/13/2017</td><td>7/1/2018</td><td>CUR</td><td>0</td><td>901</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>12/13/2017</td><td>12/13/2017</td><td>RE</td><td>0</td><td>901</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>8/31/2017</td><td>12/13/2017</td><td>RE</td><td>0</td><td>116211</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>8/31/2017</td><td>8/31/2017</td><td>RE</td><td>0</td><td>116311</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>8/31/2017</td><td>12/13/2017</td><td>RE</td><td>0</td><td>116211</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>12/13/2017</td><td>12/13/2017</td><td>RE</td><td>0</td><td>901</td><td>9</td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td>5555555</td><td>eeeeeee</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
<tr><td> </td><td> </td><td>8/31/2017</td><td>8/31/2017</td><td>RE</td><td>0</td><td>111311</td><td>7</td><td> </td><td>2</td></tr>
<tr><td> </td><td> </td><td>8/31/2017</td><td>9/1/2017</td><td>RE</td><td>0</td><td>111011</td><td>7</td><td> </td><td></td></tr>
</tbody></table>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
How about
Code:
Sub CountAreas()

   Dim Rng As Range
   
   For Each Rng In Columns(1).SpecialCells(xlBlanks).Areas
      Rng.Offset(, 9).Resize(1, 1).Value = WorksheetFunction.CountA(Rng.Offset(, 2))
   Next Rng
End Sub
 
Upvote 0
Fluff thank you very much!!! It worked perfectly! I appreciate all of your help! Thanks again!
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top