vba ie radio select

Lo031514

New Member
Joined
Aug 26, 2017
Messages
13
Hi everyone,

I would like to click or select one of the radio, but I don't know how to write VBA if I want to select the data-index=1.:confused::confused:

Thanks for helping in advance.

PHP:
<tr data-index="1" data-uniqueid="10178" class="selected"> <td class="bs-checkbox "><input data-index="1" name="btSelectItem" type="radio" value="10178" class="ignore-access-ctrl"></td> <td style="width: 150px; ">CTXXXX</td> <td style="width: 150px; ">AADepartment</td> </tr>

PHP:
<input data-index="1" name="btSelectItem" type="radio" value="10178" class="ignore-access-ctrl">

PHP:
<input type="hidden" id="_commonPopupTable_select_rows_json" value="[{"code":"CTXXXX","id":10178,"name":"AADepartment","rownum_":1,"_commonpopuptable_check_state":true}]"
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
What is the URL? Without that I can only guess, so try this maybe:
Code:
    Dim HTMLdoc As HTMLDocument
    Dim radioInput As HTMLInputElement
    Set HTMLdoc = IE.document
    Set radioInput = HTMLdoc.getElementsByName("btSelectItem")(0)
    radioInput.Click
Assumes IE is the InternetExplorer object with the web page loaded, and the radio button is the first input element with name "btSelectItem" (the (0) in the above code). Also requires references to MS HTML Object Library, set via Tools - References.
 
Upvote 0
Hi john , thanks for replying but it doesn't work. And I cannot provide the link as it is internal website. The website shows the button like "Q" and open a radio box and click the one I need.
 
Upvote 0
It's not very clear from your reply, but do you click the button "Q" and then several radio buttons appear and then you click a specific radio button? Maybe posting the HTML showing the button (and 2 or 3 of its parent elements) and the radio buttons might help, but without seeing the web page it is difficult to give a specific VBA solution.
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,858
Members
449,194
Latest member
HellScout

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