Vba: Check multiple options in html checkbox

42Nice

New Member
Joined
Jun 18, 2018
Messages
8
Hi,

The goal is to Check multiple html checkbox options in a webform.Nothing works for me, probably due to a wrong approach & syntax.
The vraiables that should to be checked are stored in 1 cell per line, and seperated with delimiter "|".

For example - Cell J(i) contains: "roleA|RoleB|RoleC" etc. Per the data stored in Cell J(i) 3 roles should be checked in the checkbox.
Code:
 Doc.getElementById("Master_cphBody_divRoles").Checked = Value sht.Range("J" & i).Value
       delimiter = "|"
Each row represents 1 unique form that need to be filled, and cell "H" row i can contain even 30 options that need to be checked in the checkbox.

Obviosly it isn't working. Below is an example of an easier case where I only needed to choose between 2 options:
Code:
If sht.Range("I" & i).Value = "Y" Then
            Doc.getElementById("Master_cphBody_chkExemptFromResRequest").Checked = True
ElseIf sht.Range("I" & i).Value = "N" Then
            Doc.getElementById("Master_cphBody_chkExemptFromResRequest").Checked = False
End If

Hope some one has a clue how to approach this one, please let me know if you you need more data or the html elements availiable.

Thanks alot,
Nice42
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,215,428
Messages
6,124,832
Members
449,190
Latest member
rscraig11

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