BigRusty82
New Member
- Joined
- Jan 28, 2021
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Hi all,
I have a simple code that looks up from a sheet, to paste postcodes into a website then click a button. What i could really do with is then exporting the output into excel. The issue is sometimes if the postcode is found a dropdown box will appear, if it does not appear then just some text appears. I dont need to know the data in the box, just really a True or False if this happens or the output of the text.
This is the current code, it works up until the output part.
A postcode that brings a drop down is LE130AA and one that returns the text is NN4 7RG
Any help would be greatly apricated. Thanks
BRS
I have a simple code that looks up from a sheet, to paste postcodes into a website then click a button. What i could really do with is then exporting the output into excel. The issue is sometimes if the postcode is found a dropdown box will appear, if it does not appear then just some text appears. I dont need to know the data in the box, just really a True or False if this happens or the output of the text.
This is the current code, it works up until the output part.
A postcode that brings a drop down is LE130AA and one that returns the text is NN4 7RG
VBA Code:
Sub FCC_GWC_Melton()
Dim IE As Object
Dim doc As HTMLDocument
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate "https://www.gardenwasteclub.co.uk/melton/"
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set doc = IE.document
For intRow = 2 To 1407
IE.Visible = True
IE.navigate "https://www.gardenwasteclub.co.uk/melton/"
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
doc.getElementById("gwc-pc").Value = ThisWorkbook.Sheets("CODE").Range("A" & intRow).Value
doc.getElementById("gwc-button").Click
StrMsg = doc.getElementById("pc_msg")
ThisWorkbook.Sheets("CODE").Range("B" & intRow).Value = StrMsg
Application.Wait DateAdd("s", 2, Now)
Next
End Sub
Any help would be greatly apricated. Thanks
BRS