# Find which ID follows a string of text in VBA



## noctash (Dec 19, 2022)

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*" ....


----------

