Hello MrExcel
I'm atm trying to make a VBA Code that works the same way as CountIf in excel. The Countif i'm useing in excel goes like this =CountIf(B2:B100;2 - Not good) (this goes for all the prioritys 1 - 3). I was hoping you could help me make this to VBA Code, and will be able to look like this.
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]Priority[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]1 - Really bad[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2 - Not good[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]3 - OK[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]SUM[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]
This is a outtake from my excel [TABLE="class: outer_border, width: 1000"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]Case[/TD]
[TD]Priority[/TD]
[TD]Title[/TD]
[TD]Title-Long[/TD]
[TD]Status[/TD]
[TD]Project[/TD]
[TD]Type[/TD]
[TD]Tags[/TD]
[/TR]
[TR]
[TD]1355512[/TD]
[TD]3 - OK[/TD]
[TD]Title1[/TD]
[TD]TitleName 1[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Bug[/TD]
[TD]Blank[/TD]
[/TR]
[TR]
[TD]4215211[/TD]
[TD]2 - Not good[/TD]
[TD]Title2[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Bug[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]blank[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]4213451[/TD]
[TD]1 - Really bad[/TD]
[TD]Title4[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]inquiry[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]blank[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]4142341[/TD]
[TD]2 - Not good[/TD]
[TD]Title10[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-5[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]inquiry[/TD]
[TD]Tag 3[/TD]
[/TR]
[TR]
[TD]1456621[/TD]
[TD]3 - OK[/TD]
[TD]Title 6[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-4[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Bug[/TD]
[TD]Tag 5[/TD]
[/TR]
</tbody>[/TABLE]
I'm atm trying to make a VBA Code that works the same way as CountIf in excel. The Countif i'm useing in excel goes like this =CountIf(B2:B100;2 - Not good) (this goes for all the prioritys 1 - 3). I was hoping you could help me make this to VBA Code, and will be able to look like this.
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD]Priority[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]1 - Really bad[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2 - Not good[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]3 - OK[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]SUM[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]
This is a outtake from my excel [TABLE="class: outer_border, width: 1000"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]Case[/TD]
[TD]Priority[/TD]
[TD]Title[/TD]
[TD]Title-Long[/TD]
[TD]Status[/TD]
[TD]Project[/TD]
[TD]Type[/TD]
[TD]Tags[/TD]
[/TR]
[TR]
[TD]1355512[/TD]
[TD]3 - OK[/TD]
[TD]Title1[/TD]
[TD]TitleName 1[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Bug[/TD]
[TD]Blank[/TD]
[/TR]
[TR]
[TD]4215211[/TD]
[TD]2 - Not good[/TD]
[TD]Title2[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Bug[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]blank[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]4213451[/TD]
[TD]1 - Really bad[/TD]
[TD]Title4[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]inquiry[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]blank[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]4142341[/TD]
[TD]2 - Not good[/TD]
[TD]Title10[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-5[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]inquiry[/TD]
[TD]Tag 3[/TD]
[/TR]
[TR]
[TD]1456621[/TD]
[TD]3 - OK[/TD]
[TD]Title 6[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: outer_border"]
[TD="width: 64"]Active[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 76"]
<tbody>[TR="class: outer_border"]
[TD="width: 76"]2014-4[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Bug[/TD]
[TD]Tag 5[/TD]
[/TR]
</tbody>[/TABLE]