Hi!
I'm trying to trying to automate a lookup process in VBA, but I can't really get it to work. Would really appreciate if anyone could help me with this. So, here's what I'm trying to do:
I want to automatically populate cell F4 with a number wich is in the first part of a string on a website, after entering a 9 digit number in cell C5. Here's the process described with example numbers:
Thank you,
All the best,
Stig
I'm trying to trying to automate a lookup process in VBA, but I can't really get it to work. Would really appreciate if anyone could help me with this. So, here's what I'm trying to do:
I want to automatically populate cell F4 with a number wich is in the first part of a string on a website, after entering a 9 digit number in cell C5. Here's the process described with example numbers:
- First the user enter the nine digit number in cell C5, example: 915690823
- Then, the VBA opens an internet browser on this specific website: Nøkkelopplysninger fra Enhetsregisteret - Brønnøysundregistrene
- Then copy the value in cell C5 to the search field called "Organisasjonsnummer" (when opening the Inspect Element, we see that the name is "orgnr") and enter do the search (button called "Søk").
- The result shows now open data about a specific businesses in Norway, and down at the page we see that the table displays "Næringskode(r):", and the string next to it in this example shows "70.220 Bedriftsrådgivning og annen administrativ rådgivning" (when opening the Inspect Element, we see that the class is "col-sm-8")
- Now, I want the VBA to copy the number in the start of the string, in this example "70.220" into cell F4. The number vary in length but is always in the start of the string, separated from the rest with a space.
Thank you,
All the best,
Stig