Help to navigate Internet Explorer using VBA

  • Hi All

    Apologies if I break any rules, I have tried my hardest. I'm sure there is an easy solution but it is evading me!

    Whilst I am proficient at VBA, I haven't used it t navigate the internet before. I have borrowed and slightl altered some code I sourced online to log in into a website and navigate to a specific site.

    The page I am now on, has a table that is updated weekly. I would like to allow a user to search for a date, in this instance 07/03/2020, and based on that date follow the corresponding href.

    In the code below, I would need to find "/My/Result?sectionId=795&compNumber=202618&division=1" to navigate to that page.

    Thank you in advance, any other feedback welcome.

    Below is my current VBA code (to be tidied up at a later date!):

    The webpage code can be found here (some amendments made to make anonymous):

  • Tom, Welcome to the Forum

    like to confirm few things , does after longing into website it opens a new page?

    if it does not then the instance you set to ie is already active you can use the reference to manipulate further data.

    if no you need to loop through all ie instance to get hold of your new page example below.

  • Hi Ashu

    Thank you for the response.

    I initially load this page,…?returnUrl=%2fMy%2fResult, which allows me to log in. Once the log in is accepted, I get redirected to -

    This was to save me logging in and then finding my results and clicking that.

    What I am struggling with is the table in My Results.

    There are c890 rows and this will grow each week.

    What I essentially want to do is search for a date, e.g. 07/03/2020, and then click the link in the Comp cell. Each comp has a href that then links to the results for that comp. From there I will just be extracting the whole table which I should be ok with.

    At the moment, I have figured something out that looks like it could work but I am sure won't be the best solution. I have added the code below but I am VERY aware that it needs tidying up! It essentially loops through the table until it finds 07/03/2020 and then returns the full row of data.

    Each string I am then just removing everything apart from the href. Aware that I could do this much more simply, but I just wanted to step through it before I tidied up the approach.

    Also aware that I could just print the table to excel and search there but I want something neater than that!

    Apologies for rambling, thanks again.

    Comp Score Date Type Club Collapsible Dropdown
    Stableford 38 07/03/2020 Stableford Test Golf Club
    Feb Medal 75 29/02/2020 Medal Test Golf Club

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!