I've been working with this little project of mine for quite a while now and now I seem to be stuck right before the finish line:
I've got a macro that opens IE and navigates to a site in our intranet, fills a form found on the website and submits it. So now we're in the right webpage and there's 3 tables on the page. I'm trying to copy the last one to the page in Excel for further calculations but
copies all the values from the whole table in a single cell.
How do I get the code to split the text into cells? I know there's going to be 10 columns in each row but the number of rows can be anything from 2 (including the headers) to 50 +.
Also, how do I tell the browser to go back to previous page? Once I'll get the values copied I need to loop the code back to the form page, change the value of the month dropdown, submit the form and copy the new values from the same table below the previous months values.
If I'm using the navigate back to first URL IE seems to open the form without any values but using the back button it remembers the previous values and I don't have to enter all the values again. I know it shouldn't make that much of a difference to have the code fill the form again but I'm trying to find a better way.
I've got a macro that opens IE and navigates to a site in our intranet, fills a form found on the website and submits it. So now we're in the right webpage and there's 3 tables on the page. I'm trying to copy the last one to the page in Excel for further calculations but
Code:
Range("A1").Value = IE.document.getelementsbytagname("Table")(2).innertext
How do I get the code to split the text into cells? I know there's going to be 10 columns in each row but the number of rows can be anything from 2 (including the headers) to 50 +.
Also, how do I tell the browser to go back to previous page? Once I'll get the values copied I need to loop the code back to the form page, change the value of the month dropdown, submit the form and copy the new values from the same table below the previous months values.
If I'm using the navigate back to first URL IE seems to open the form without any values but using the back button it remembers the previous values and I don't have to enter all the values again. I know it shouldn't make that much of a difference to have the code fill the form again but I'm trying to find a better way.