Hi.
I have a collection of data which consists of several items for which I will collect based on the criteria I have specified using the For Next statement.
and here is an example of the data :
[TABLE="class: grid, width: 200, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]User[/TD]
[TD]ID[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Jhon[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]dean[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]billy[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]smith[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]lovely[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]amber[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Lina[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]joy[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]...[/TD]
[TD]...[/TD]
[/TR]
</tbody>[/TABLE]
the results I want :
[TABLE="class: grid, width: 200, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]dean[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]billy[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]amber[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]joy[/TD]
[/TR]
</tbody>[/TABLE]
and here is the rough code that I use, which results are not what I want
thanks in advance for your help
I have a collection of data which consists of several items for which I will collect based on the criteria I have specified using the For Next statement.
and here is an example of the data :
[TABLE="class: grid, width: 200, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]User[/TD]
[TD]ID[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Jhon[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]dean[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]billy[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]smith[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]lovely[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]amber[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Lina[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]joy[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]...[/TD]
[TD]...[/TD]
[/TR]
</tbody>[/TABLE]
the results I want :
[TABLE="class: grid, width: 200, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]dean[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]billy[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]amber[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]joy[/TD]
[/TR]
</tbody>[/TABLE]
and here is the rough code that I use, which results are not what I want
Code:
For a = 2 To 10
If Cells(a, 2) = "B" Then
For b = 1 To 4
Cells(b, 4) = Cells(a, 1)
Next b
End If
Next a
thanks in advance for your help