Hi All
I want to have a Function with select case that:
range value is range(A2: last row) and group by range(B2:lastrow) like below table have 04 group:
The code of function like this:
I'm not sure how to code right to do this, please help me
Thanks./.
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A001[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]B002[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]A002[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]B004[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]C005[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]C001[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]A010[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]B010[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]G010[/TD]
[TD]15[/TD]
[/TR]
</tbody>[/TABLE]
I want to have a Function with select case that:
range value is range(A2: last row) and group by range(B2:lastrow) like below table have 04 group:
The code of function like this:
Code:
Funtion ()
for i = range(A2: lastrow)
select case group by range(B2:last row)
Case a = Array("B004")
'group by range (B2:last row) = "20"
Case a = Array("A002","G010")
'group by range (B2:last row) = "15"
Case a = Array("B002","B010")
'group by range (B2:last row) = "10"
Case Esle --->
'group by range (B2:last row) = "7"
next i
End Function
I'm not sure how to code right to do this, please help me
Thanks./.
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]A001[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]B002[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]A002[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]B004[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]C005[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]C001[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]A010[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]B010[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]G010[/TD]
[TD]15[/TD]
[/TR]
</tbody>[/TABLE]