0

How i can choose a specific value using excel vba?

    <div class="drpSirketler">
    <select class="selectBox homepage selectSirketler" style="padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px">
    <option selected="selected" value="default">Şirket Seçiniz</option>
    <option selected="selected" value="-1">Tüm Finansal Tablolar</option>
    <option value="1626">ACISELSAN ACIPAYAM SELÜLOZ SANAYİ VE TİCARET A.Ş.</option>
    <option value="831">ADANA ÇİMENTO SANAYİİ T.A.Ş.</option>
SierraOscar
  • 17,507
  • 6
  • 40
  • 68
  • Welcome to Stack Overflow. Take a look at - [how to ask](http://stackoverflow.com/help/how-to-ask) and research. Have you looked at other vba answers for inspiration like http://stackoverflow.com/a/19285535/4606130 or http://stackoverflow.com/q/17818903/4606130? What does the 2 in your title mean - please proof read before posting? It will make people more willing to help. – micstr Feb 09 '16 at 10:25

1 Answers1

0

Where doc is the HTMLdocument object:

doc.GetElementsByClassName("selectBox homepage selectSirketler")(0).Value = "default"

should produce the "Şirket Seçiniz" value.


If there are other elements in the document with the same class name, then you will have to iterate through the collection of those tags and test each one.

SierraOscar
  • 17,507
  • 6
  • 40
  • 68