VBA Sum & Combine Data

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,168
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Good morning I have a large data set approx 100,000 rows.
I need to sum and combine the data based on Emp ID and DEPT only if they are the same.
If the Emp ID and DEPT are not the same then leave it be.
There will always be a Cur or Re in Column (S)
The data must be Combined and summed in Cur. Cur stands for current!
<style type="text/css">
table.tableizer-table {
font-size: 8px;
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>Emp ID</th><th>LASTFIRST</th><th>SCORE</th><th>DEPT</th><th>AUGMEM</th><th>AUGATT</th><th>SEPMEM</th><th>SEPATT</th><th>OCTMEM</th><th>OCTATT</th><th>Cur or Re</th></tr></thead><tbody>
<tr><td>8043998</td><td>wwwww</td><td>10</td><td>A</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>1</td><td>Cur</td></tr>
<tr><td>8043998</td><td>wwwww</td><td>10</td><td>A</td><td>0</td><td>0</td><td>19</td><td>5</td><td>0</td><td>0</td><td>Re</td></tr>
<tr><td>8043998</td><td>wwwww</td><td>10</td><td>A</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>Re</td></tr>
<tr><td>9998876</td><td>xxxxxxxx</td><td>11</td><td>B</td><td>1</td><td>0</td><td>19</td><td>0</td><td>21</td><td>0</td><td>Cur</td></tr>
<tr><td>8052141</td><td>yyyyyyyy</td><td>10</td><td>C</td><td>0</td><td>0</td><td>8</td><td>0</td><td>3</td><td>0</td><td>Cur</td></tr>
<tr><td>8052141</td><td>yyyyyyyy</td><td>10</td><td>C</td><td>1</td><td>1</td><td>5</td><td>3</td><td>0</td><td>0</td><td>Re</td></tr>
<tr><td>7765432</td><td>zzzzzzzzz</td><td>9</td><td>D</td><td>0</td><td>0</td><td>0</td><td>0</td><td>21</td><td>5</td><td>Cur</td></tr>
<tr><td>7765432</td><td>aaaaaaa</td><td>9</td><td>E</td><td>1</td><td>1</td><td>19</td><td>0</td><td>0</td><td>0</td><td>Re</td></tr>
</tbody></table>

To this
<style type="text/css">
table.tableizer-table {
font-size: 8px;
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>Emp ID</th><th>LASTFIRST</th><th>SCORE</th><th>DEPT</th><th>AUGMEM</th><th>AUGATT</th><th>SEPMEM</th><th>SEPATT</th><th>OCTMEM</th><th>OCTATT</th><th>Cur or Re</th></tr></thead><tbody>
<tr><td>8043998</td><td>wwwww</td><td>10</td><td>A</td><td>1</td><td>0</td><td>19</td><td>5</td><td>1</td><td>1</td><td>Cur</td></tr>
<tr><td>9998876</td><td>xxxxxxxx</td><td>11</td><td>B</td><td>1</td><td>0</td><td>19</td><td>0</td><td>21</td><td>0</td><td>Cur</td></tr>
<tr><td>8052141</td><td>yyyyyyyy</td><td>10</td><td>C</td><td>1</td><td>1</td><td>13</td><td>3</td><td>3</td><td>0</td><td>Cur</td></tr>
<tr><td>7765432</td><td>zzzzzzzzz</td><td>9</td><td>D</td><td>0</td><td>0</td><td>0</td><td>0</td><td>21</td><td>5</td><td>Cur</td></tr>
<tr><td>7765432</td><td>aaaaaaa</td><td>9</td><td>E</td><td>1</td><td>1</td><td>19</td><td>0</td><td>0</td><td>0</td><td>Re</td></tr>
</tbody></table>
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,214,932
Messages
6,122,334
Members
449,077
Latest member
Jocksteriom

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