this is the data source i have:
<table style="width: 448px; height: 584px;" border="0" cellpadding="0" cellspacing="0"><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:4937;width:101pt" width="135"> <col style="mso-width-source:userset;mso-width-alt:4242;width:87pt" width="116"> <tbody><tr style="height:15.0pt" height="20"> <td style="height:15.0pt;width:48pt" height="20" width="64">s_id</td> <td style="width:101pt" width="135">Team</td> <td style="width:87pt" width="116">suppliername</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> </tbody></table>
i need to create few column charts which based on the suppliername, in the example above mean i need to create 2 column charts, and i have build some coding buy jz able to create the 1st chart only
is so weird that the loop will end once it met the if condition, instead of continue, how can I make it to continue loop and build the rest of the chart?
Thanks for help.
<table style="width: 448px; height: 584px;" border="0" cellpadding="0" cellspacing="0"><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:4937;width:101pt" width="135"> <col style="mso-width-source:userset;mso-width-alt:4242;width:87pt" width="116"> <tbody><tr style="height:15.0pt" height="20"> <td style="height:15.0pt;width:48pt" height="20" width="64">s_id</td> <td style="width:101pt" width="135">Team</td> <td style="width:87pt" width="116">suppliername</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Material Costing</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">14</td> <td>Tactical</td> <td>elec</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Material Costing</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20" align="left">15</td> <td>Tactical</td> <td>mechanical</td> </tr> </tbody></table>
i need to create few column charts which based on the suppliername, in the example above mean i need to create 2 column charts, and i have build some coding buy jz able to create the 1st chart only
Code:
Dim IngRows As Long
Dim x As Integer
IngRows = Range("A2").CurrentRegion.Rows.Count
For x = 2 To IngRows - 1
If Not (Cells(x, 3).Text = Cells(x + 1, 3).Text) Or IsEmpty(Cells(x + 3, 3).Text) Then
Range(Cells(2, 1), Cells(x, 7)).Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range(Cells(2, 1), Cells(x, 7)), PlotBy:=xlColumns
ActiveChart.ChartType = xlColumnClustered
ActiveWindow.SmallScroll Down:=-3
End If
Next x
is so weird that the loop will end once it met the if condition, instead of continue, how can I make it to continue loop and build the rest of the chart?
Thanks for help.