Write specific value in specific row and column in Excel

Dear all,

i am working on a process which is going to run daily.

I have a Excel Worksheet with multiple rows + one colum for each date. In the process I am finding a value which needs to be written in a its relevant line and for the current date.

For example:

in cell A2 we have “CompanyA” in B1 we have the date column. Todays value for CompanyA is 2 so it needs to written into cell for CompanyA and the Coulm for today.

Do you have a clever idea how it could work?

Thanks and best regards

Hi SchnEck,

You could use the Select Filter. Read the range of your table into a datatable and then use Select to find the row:

use an assign:
dtExample.Select(“[NameColumn1]=‘CompanyA’”)(0)(“25/8/2020”) = 2 <<-- I’m assuming you know the name of the column1 (substitute NameColumn1) and the name of the date column (in this case I just put today’s date but you have to addapt it to your case).

Once assign you can write the range again.

thanks for your reply. So in my loop I have the variable “Mandant” and Todays Date as “Datum”.

The Value would be “CountPersonal”

dt_test.Select("[Mandant] = Mandant)(0)(Datum)=CountPersonal

Would that be correct?
Do you know I can use a variable in the select statemant?

I found a solution by creating a help table. Column A values from 1 to 31 and Column B with the Letter of each excel Column A to AE… Then I identify the letter with loop by searching for todays day for example today the 26 of August would be Column “Z” in the same loop i get the index of the company with in index variable from the for each loop.

If I connect both I get the correct Cell for Example Z17

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.