VBA checkbox multiple pages

p_hendyarto

New Member
Joined
May 12, 2012
Messages
4
Dear All,

is there anyone knows how to check/tick all the checkbox in multiple pages?
the site is internal site, i need to check/tick all the existing checkbox, then go to the next page (if any), check/tick all checkbox, and so on until there is no pages that contain checkbox.

the problem is for each input, may have vary pages. example input#1 have 7 checkboxes in one page, input#2 might have 20 checkboxes in 3 pages.

one thing for sure, each pages only contain max 8 checkboxes.

HTML code
HTML:
'id of check box#1
input id="dgView__ctl9_chkSelectBox" type="checkbox" name="dgView:_ctl9:chkSelectBox" 
 
'Id of checkbox#8
input id="dgView__ctl10_chkSelectBox" type="checkbox" name="dgView:_ctl10:chkSelectBox"
 
'link to second page
a href="javascript:__doPostBack('dgView$_ctl12$_ctl1','')"

please advice if anyone could assist to validate if there more check box click to the next page until there is not page anymore

thanks in advance for your help
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Perhaps you could adapt this?

Code:
Sub Macro1()

For Each ws In ThisWorkbook.Worksheets

For Each cBox In ws.CheckBoxes
cBox.Value = False
Next cBox

Next ws

End Sub
 
Upvote 0
Hi davesweep,

thanks for your feedback.
have tried your suggested but not working. Perhaps i didnt explain it clearly.

here is the HTML code in the IE
HTML:
<P><table cellspacing="0" cellpadding="3" rules="all" bordercolor="#CCCCCC" border="1" id="dgView" style="background-color:White;border-color:#CCCCCC;border-width:1px;border-style:None;width:650px;border-collapse:collapse;">
<tr style="color:White;background-color:LightSteelBlue;font-weight:bold;">
         <td style="width:4%;"> </td><td>S/O</td><td>PO</td><td>Customer order number</td><td>
                                                      <FONT face="ËÎÌå">Status</FONT>
                                               </td><td>Error cause</td><td>Inbound Scanning ready?</td><td>Acknowledgement send?</td>
</tr><tr style="color:#000066;">
         <td>
                                                      <input id="dgView__ctl3_chkSelectBox" type="checkbox" name="dgView:_ctl3:chkSelectBox" />
                                               </td><td>JKT1100493</td><td>105337288</td><td>PO1089489-1000</td><td>
                                                      <FONT face="ËÎÌå">
                                                              <span id="dgView__ctl3_lblstatus">OUTBOUND MATCHED</span></FONT>
                                               </td><td>
                                               
                                               </td>
</tr><tr style="color:#000066;">
         <td>
                                                      <input id="dgView__ctl4_chkSelectBox" type="checkbox" name="dgView:_ctl4:chkSelectBox" />
                                               </td><td>JKT1103952</td><td>105337219</td><td>PO1089503-1000</td><td>
                                                      <FONT face="ËÎÌå">
                                                              <span id="dgView__ctl4_lblstatus">OUTBOUND MATCHED</span></FONT>
                                               </td><td>
                                                      
                                       
                                               </td>
</tr><tr style="color:#000066;">
         <td>
                                                      <input id="dgView__ctl5_chkSelectBox" type="checkbox" name="dgView:_ctl5:chkSelectBox" />
                                               </td><td>JKT1104468</td><td>105221635</td><td>0274584893</td><td>
                                                      <FONT face="ËÎÌå">
                                                              <span id="dgView__ctl5_lblstatus">OUTBOUND MATCHED</span></FONT>
                                               </td><td>
                                               
</tr><tr style="color:#000066;">
         <td>
                                                      <input id="dgView__ctl6_chkSelectBox" type="checkbox" name="dgView:_ctl6:chkSelectBox" />
                                               </td><td>JKT1104468</td><td>104897292</td><td>0274495111</td><td>
                                                      <FONT face="ËÎÌå">
                                                              <span id="dgView__ctl6_lblstatus">OUTBOUND MATCHED</span></FONT>
                                               </td><td>
                                                      
                                               
</tr><tr style="color:#000066;">
         <td>
                                                      <input id="dgView__ctl7_chkSelectBox" type="checkbox" name="dgView:_ctl7:chkSelectBox" />
                                               </td><td>JKT1105010</td><td>0105401111</td><td>274783078</td><td>
                                                      <FONT face="ËÎÌå">
                                                              <span id="dgView__ctl7_lblstatus">OUTBOUND MATCHED</span></FONT>
                                               </td><td>
                                                      
                                               
</tr><tr style="color:#000066;">
         <td>
                                                      <input id="dgView__ctl8_chkSelectBox" type="checkbox" name="dgView:_ctl8:chkSelectBox" />
                                               </td><td>JKT1106671</td><td>0105406149</td><td>274786750</td><td>
                                                      <FONT face="ËÎÌå">
                                                              <span id="dgView__ctl8_lblstatus">OUTBOUND MATCHED</span></FONT>
                                               </td><td>
                                                      
                                               
</tr><tr style="color:#000066;">
         <td>
                                                      <input id="dgView__ctl9_chkSelectBox" type="checkbox" name="dgView:_ctl9:chkSelectBox" />
                                               </td><td>JKT1106671</td><td>0105406152</td><td>274786741</td><td>
                                                      <FONT face="ËÎÌå">
                                                              <span id="dgView__ctl9_lblstatus">OUTBOUND MATCHED</span></FONT>
                                               </td><td>
                                                      
                                               
</tr><tr style="color:#000066;">
         <td>
                                                      <input id="dgView__ctl10_chkSelectBox" type="checkbox" name="dgView:_ctl10:chkSelectBox" />
                                               </td><td>JKT1105011</td><td>0105381205</td><td>274772410</td><td>
                                                      <FONT face="ËÎÌå">
                                                              <span id="dgView__ctl10_lblstatus">OUTBOUND MATCHED</span></FONT>
                                               </td><td>
                                                      
                                               
</tr><tr align="Left" style="color:#000066;background-color:White;">
         <td colspan="9"><span>1</span> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl1','')" style="color:#000066;">2</a> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl2','')" style="color:#000066;">3</a> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl3','')" style="color:#000066;">4</a> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl4','')" style="color:#000066;">5</a> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl5','')" style="color:#000066;">6</a> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl6','')" style="color:#000066;">7</a> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl7','')" style="color:#000066;">8</a> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl8','')" style="color:#000066;">9</a> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl9','')" style="color:#000066;">10</a> <a href="javascript:__doPostBack('dgView$_ctl12$_ctl10','')" style="color:#000066;">...</a></td>
</tr>

from above HTML, i need to tick all the checkbox which has "OUTBOUND MATCHED" status, then go to next page, tick all the checkbox and go on until the last page.

could you advice how to do this loop and validate whether there is remaining pages or not.

if i take a look on every pages, the last checkbox on each page is started with this code

HTML:
<input id="dgView__ctl3_chkSelectBox" type="checkbox" name="dgView:_ctl3:chkSelectBox" />

ended with this code
HTML:
id="dgView__ctl10_chkSelectBox" type="checkbox" name="dgView:_ctl10:chkSelectBox" />

thank you
 
Upvote 0

Forum statistics

Threads
1,216,756
Messages
6,132,533
Members
449,733
Latest member
Nameless_

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