How to grab a specific values from excel in order to enter them into web application?

Hi,

I’m having trouble grabbing specific set of data from excel in order to input it into a web application, please see below images for reference:

  1. First column of the excel file has a master number (repeating a couple of times) that I need to enter into a web application and then click enter. For this example let’s use 883716.
  2. Then I need to grab all percentages for numbers which are only connected to that master number (so in this case 4,5,6,7 excluding L,M,S,XL which are connected to number 983716), in this example:
    (second to last column)
  • 4 → 14%
  • 5 → 18%
  • 6 → 32%
  • 7 → 36%
  1. Then I need to input these percentages into cells which have the same numbers as in step 2, so in this example because on the excel sheet number 4 has a value of 14 I have to then match it on the number “4” which is visible on the website and enter 14.
  2. I have to create a loop which repeats the process (I click esc to go back, then input another master number - 983716, click enter, find letter “L” on the website and input 28 next to it, for “M” 29, etc. and then esc, enter another master number and so on).

Would it be possible to create that kind of loop?

Thank you in advance for all your help,
Jakub

Hi,

In this case, I recommend to use Dictionary and double loop as the following.

dict = dt.AsEnumerable.GroupBy(Function(r) r(0).ToString).ToDictionary(Function(g) g.Key, Function(g) g.ToArray)

note: dict is Dictionary<string, DataRow()> type.

Sample20221111-2.zip (9.0 KB)

Regards,

Hi @KubaK

You can first try getting unique from the first column. Now run a loop on those unique values . Use a filter datatable and it will give you all the rows with that specific number , then perform you steps in the loop to enter the data

Cheers