VBA code to select from an HTML drop down, using value rather than index
问题 I'm fairly new to VBA and HTML. I am writing a VBA macro which navigates through a website, before filling in a web form. During navigation, the script needs to pick an option from a drop-down menu. I am currently using the following (no doubt awful, but functional) code, which finds the correct drop-down menu before selecting the option at index 2. Set dropOptions = HTMLDoc.getElementsByTagName("select") For Each op In dropOptions If op.getAttribute("name") = "tilastojakso" Then op.Focus op