Posts by ohyaitsysh

Important Notice

Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

    I am trying to automate the scraping of data from a particular website within an intranet. Step one of the code is simply getting VBA to Log on for me with my credentials.

    I changed the url (and username/password accordingly), to see if it was the code or the website and the code logs me in just fine.

    Also, the code displays the webpage for debugging purposes, and it seems as the username and password don't show up in the text boxes, but if I use my mouse to click on the username/password box, both boxes are filled in with my correct username and password as programmed in the code. When I run this macro i get the error "Run time error 438: Object doesn't support this property or method." The problem occurs in the highlighted portions below, Here is my code:

    Re: How To Extract Certain substring within a cell of Strings

    Thanks for your help! unfortunately it has to be through vba because I need to make a more generalized code that works for many different types of data, I just submitted like this to narrow down the problem at hand. Also your Trim command displays "NOSE" on excel.

    This is what is in my cell A5:

    "Model:55555 blue toy car"

    I want to extract '55555' from the whole string and display it into a different cell (D4).
    I have:
    Start = InStr("Model:", A5) + 6
    Range("D4").Value = Mid(A5, InStr("Model:", A5) + 6, 5)

    When I run this, nothing shows up i cell D4.

    To debug it, I threw in: "Range("C2").Value = Start"
    and C2 displays a 7 so I know the first line of code works. I looked up the Mid function and the format seems to be Mid("string", n, length). I can't put in
    "Model:55555 blue toy car" as the string because the model number will change so I want a more general code. Is there a different function besides MID that will work better?