Find which ID follows a string of text in VBA

noctash

New Member
Joined
Aug 4, 2022
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I am trying to input data into a web form that has a bunch of instances like the following.
The "Reference" text in the web page bolded below would be the the same as column headers in excel of my data set, and the "NumbericValue_0" is where I would input the data from that column. I have a bunch of headers, and they aren't always in the right order on the form such that I could always assume Header 1 = NumericValue_0 etc.

Is there a way I can lookup which "NumericValue_#" is tied to which "Reference#"?
My endgoal is to have the VBA code look at each header, find the corresponding Reference# on the web page, find the NumericValue# for that Reference#, and set the NumericValue# to the data under the header.

Thank you in advance for any help or tips!

Example of what the HTML looks like:

<tr>
<td>
REFERENCE1
</td>
...
<td>
<div class="form-group">
<input class="form-control checks"
id="NumericValue_1" ....
<td>
REFERENCE2
</td>
...
<td>
<div class="form-group">
<input class="form-control checks"
id="NumericValue_2" ....
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top