Hello, hope for help!
I have a VBA script that is functional but I'd like to make it a bit better.
This is a question for the folling page:
https://www.e-control.at/konsumenten/service-und-beratung/toolbox/tarifkalkulator
1. The query of the first page works: postcode = 1010 & kwh consumption = 1000Then send
2. The second page is not the optimal page I would like to query. On this page I would like to query the table in column 1. If the query finds a link click on this link. (loop this)
3. On page 3, I would then copy from the table predefined names of the lines of the result.
The predefined names are in Excel in table A1 of a row.The result should be under the supplier's name. The supplier name should be copied from the table from the web. The product of the supplier should be placed under the supplier name in the same column.(loop this)
(please loop to page 2.)
Info:
The string from the link after the? Is for me unfortunately too complicated, since this consists of nothing but variable. The structure of the homepage is also not exactly programmed according to standard html. This page is my opinion in XHTML.Perhaps this information helps.
My code is currently:
thx for help!
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">The string from the link after the? Is for me unfortunately too complicated, since this consists of nothing but variable. The structure of the homepage is also not exactly programmed according to standard html. This page is my opinion in XHTML.Perhaps this information helps.
</body>****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">I have a VBA script that is functional but I'd like to make it a bit better.I have a VBA script that is functional but I'd like to make it a bit better.</body>
I have a VBA script that is functional but I'd like to make it a bit better.
This is a question for the folling page:
https://www.e-control.at/konsumenten/service-und-beratung/toolbox/tarifkalkulator
1. The query of the first page works: postcode = 1010 & kwh consumption = 1000Then send
2. The second page is not the optimal page I would like to query. On this page I would like to query the table in column 1. If the query finds a link click on this link. (loop this)
3. On page 3, I would then copy from the table predefined names of the lines of the result.
The predefined names are in Excel in table A1 of a row.The result should be under the supplier's name. The supplier name should be copied from the table from the web. The product of the supplier should be placed under the supplier name in the same column.(loop this)
(please loop to page 2.)
Info:
The string from the link after the? Is for me unfortunately too complicated, since this consists of nothing but variable. The structure of the homepage is also not exactly programmed according to standard html. This page is my opinion in XHTML.Perhaps this information helps.
My code is currently:
Code:
[/COLOR][/FONT]
[FONT=arial][COLOR=#212121]Option ExplicitSub TableExample() Dim IE As Object Dim doc As Object Dim strURL As String Dim I As Integer strURL = "https://www.e-control.at/konsumenten/service-und-beratung/toolbox/tarifkalkulator" ' replace with URL of your choice Set IE = CreateObject("InternetExplorer.Application") With IE .Visible = True .navigate strURL Do Until .readyState = 4: DoEvents: Loop Do While .Busy: DoEvents: Loop 'For i = 0 To 1 Application.wait (Now + TimeValue("0:00:10")) 'Application.Speech.Speak ("Daten werden Geladen" & Time)'Next i IE.document.getElementById("_tk_portlet_WAR_tk_:tk-form-start:tk-index-search-form-zip").Value = _ Sheets("Tarife e-control").Range("A1").Value IE.document.getElementById("_tk_portlet_WAR_tk_:tk-form-start:tk-index-search-form-electricity-consumption").Value = _ Sheets("Tarife e-control").Range("A2").Value 'click the 'go' button IE.document.getElementById("_tk_portlet_WAR_tk_:tk-form-start:tk-index-search-form-search-button").Click Do Until .readyState = 4: DoEvents: Loop Do While .Busy: DoEvents: Loop Set doc = IE.document 'For i = 0 To 1 Application.wait (Now + TimeValue("0:00:30")) 'Application.Speech.Speak ("Daten werden geladen" & Time) 'Next i '.Quit GetAllTables doc End With End Sub Sub GetAllTables(doc As Object) ' get all the tables from a webpage document, doc, and put them in a new worksheet Dim ws As Worksheet Dim rng As Range Dim tbl As Object Dim rw As Object Dim cl As Object Dim tabno As Long Dim nextrow As Long Dim I As Long Dim xl As String Dim y As Integer Set ws = Sheets("Stocks") For Each tbl In doc.getElementsByTagName("Table") tabno = tabno + 1 nextrow = nextrow + 1 Set rng = ws.Range("B" & nextrow) rng.Offset(, -1) = "Table " & tabno For Each rw In tbl.Rows For Each cl In rw.Cells rng.Value = cl.outerText Set rng = rng.Offset(, 1) I = I + 1 Next cl nextrow = nextrow + 1 Set rng = rng.Offset(1, -I) I = 0 Next rw Next tbl ws.Cells.ClearFormats End Sub[/COLOR][/FONT][FONT=arial][COLOR=#212121]
thx for help!
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">The string from the link after the? Is for me unfortunately too complicated, since this consists of nothing but variable. The structure of the homepage is also not exactly programmed according to standard html. This page is my opinion in XHTML.Perhaps this information helps.
</body>****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">I have a VBA script that is functional but I'd like to make it a bit better.I have a VBA script that is functional but I'd like to make it a bit better.</body>