Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Excel VBA to Sign Into and then Extract Data from a Website
Thanks Thanks: 0 Likes Likes: 0

  1. #11
    Board Regular
    Join Date
    Oct 2007
    Posts
    5,757
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Excel VBA to Sign Into and then Extract Data from a Website

    Quote Originally Posted by sylvesterbetta View Post
    Hi,

    will like to check how can I change the coding so as that I can a specific column of a table.

    Please assist.
    Thanks
    Loop through the rows in the required column, e.g. cells(0) means the first column:
    Code:
        Dim r As Long
        For r = 0 To table.Rows.Length - 1
            Debug.Print table.Rows(r).Cells(0).innerText
        Next

  2. #12
    New Member
    Join Date
    Nov 2018
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel VBA to Sign Into and then Extract Data from a Website

    Quote Originally Posted by John_w View Post
    Loop through the rows in the required column, e.g. cells(0) means the first column:
    Code:
        Dim r As Long
        For r = 0 To table.Rows.Length - 1
            Debug.Print table.Rows(r).Cells(0).innerText
        Next
    Hi John,

    Thanks for the reply. But will you be able to explain the coding as I dun understand why do we need to use "debug.print"

    Please assist.

    Thanks.

  3. #13
    Board Regular
    Join Date
    Oct 2007
    Posts
    5,757
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Excel VBA to Sign Into and then Extract Data from a Website

    You don't need Debug.Print. Just change it to the required sheet/cell reference to write the value to a cell, as with the previous code:
    Code:
            Worksheets("Auto SSD Here").Range("A1").Offset(r).Value = table.Rows(r).Cells(0).innerText

  4. #14
    New Member
    Join Date
    Nov 2018
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel VBA to Sign Into and then Extract Data from a Website

    Quote Originally Posted by John_w View Post
    You don't need Debug.Print. Just change it to the required sheet/cell reference to write the value to a cell, as with the previous code:
    Code:
            Worksheets("Auto SSD Here").Range("A1").Offset(r).Value = table.Rows(r).Cells(0).innerText
    Hi John, I did as what u had mention and was being prompt “Run-time error ‘424’, Object required” . Will you be able to assist n advice what went wrong. Thanks

  5. #15
    Board Regular
    Join Date
    Oct 2007
    Posts
    5,757
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Excel VBA to Sign Into and then Extract Data from a Website

    It was based on the previously posted code, so have you included the table reference?
    Code:
        Dim table As Object
        Dim r As Long
        Set table = IE.document.getElementsByTagName("TABLE")(0)   '0 = 1st table, 1 = 2nd table, etc.
        For r = 0 To table.Rows.Length - 1
            Worksheets("Auto SSD Here").Range("A1").Offset(r).Value = table.Rows(r).Cells(0).innerText
        Next
    The above is all very generic and based on the OP's code. Please start your own thread if you need help with your specific site.

  6. #16
    New Member
    Join Date
    Nov 2018
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Excel VBA to Sign Into and then Extract Data from a Website

    Hi John, thanks for your help. I did that’s why dun understand why the error?

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •