Hi Guys,
I'm doing a code to create multiple accounts using FB as an example.
i'm having issues selecting the gender from the page.
If in the cell the sex is female and corresponds to u_1_4, typing this in the code would work.
Looking at the highlighted part in red, i'll like the formula to be more flexible to select the gender based on my excel sheet.
is there a way out of this?
I'm doing a code to create multiple accounts using FB as an example.
i'm having issues selecting the gender from the page.
If in the cell the sex is female and corresponds to u_1_4, typing this in the code would work.
Looking at the highlighted part in red, i'll like the formula to be more flexible to select the gender based on my excel sheet.
is there a way out of this?
HTML:
<label class="_58mt" for="u_1_4">Female</label>
<input name="sex" class="_8esa" id="u_1_4" type="radio" value="1">
VBA Code:
Private Sub insert1()
Dim ie As Object, doc As HTMLDocument
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate "https://www.facebook.com/"
Do While ie.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set doc = ie.Document
doc.getElementById("u_0_2").Click
Dim counter, maxrow As Integer, sex As Range
maxrow = Range("a1").CurrentRegion.Rows.count
gender[COLOR=rgb(209, 72, 65)][B] = Sheets("Data").Range("h" & counter + 1).Value[/B][/COLOR]
For counter = 1 To maxrow
doc.getElementById("u_1_b").Value = Sheets("Data").Range("a" & counter + 1).Value
doc.getElementById("u_1_d").Value = Sheets("Data").Range("b" & counter + 1).Value
doc.getElementById("u_1_g").Value = Sheets("Data").Range("c" & counter + 1).Value
doc.getElementById("u_1_l").Value = Sheets("Data").Range("d" & counter + 1).Value
doc.getElementById("day").Value = Sheets("Data").Range("e" & counter + 1).Value
doc.getElementById("month").Value = Sheets("Data").Range("f" & counter + 1).Value
doc.getElementById("year").Value = Sheets("Data").Range("h" & counter + 1).Value
[B][COLOR=rgb(184, 49, 47)] doc.getElementById("gender").Click[/COLOR][/B]
Next
End Sub