• Copy table rows from HTML (VBA/Excel/ 2000+)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Copy table rows from HTML (VBA/Excel/ 2000+)

    Author
    Topic
    #455897

    I am lost attempting to copy rows x through y of an HTML table so that I can paste them into Excel. Can anyone help me with a snippet?

    T.I.A.

    Viewing 1 reply thread
    Author
    Replies
    • #1137044

      Are you automating IE to retrieve the page, or are you using a control in a userform, or is it an Excel web query?

      • #1137056

        I’m using Excel VBA to open a query in the lounge, then selectively capture the returned table, I am adapting the code which you provided here.

        • #1137064

          So in that thread, IE opens and VBA uses the MSHTML library to read the structure of the document, including walking through the rows/cells in a table. Using that approach, of course, you could transfer cell contents one at a time. If you want to use the clipboard, hmmm, I don’t know whether that actually is possible.

          • #1137082

            Thanks for the consideration Jefferson.

            I will advise of my success–or failure. thankyou

    • #1137089

      Have you seen this page, after studying the url of a search page you might use it to create a dynamic web query base don a cell:
      http://www.jkp-ads.com/articles/webquery.asp%5B/url%5D

    Viewing 1 reply thread
    Reply To: Copy table rows from HTML (VBA/Excel/ 2000+)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: