How to read header and subleaders dynamically

Hi All,

I am tryin to read the sub header dynamically in excel , depending on the current and previse month.

how i can get the value of May - mark , May - subject , Jan - mark and Jan mark. .

dynamically, in each month i need to get the data.

Thank you.

1 Like

Hey @Dev2

It’s possible

But how is that dynamic part in your case ?

Thanks
#nK

Hello @Dev2

Are you using this template only for the automation purpose or you are sharing to someone else as well?

If its a static template for automation, will it be possible to keep column names as “January Mark”,“January Subject”," February Mark" etc…

Then you can easily do that.

Hi @Nithinkrishna

i need to get the data for the current month,

Hi @Rahul_Unnikrishnan

yes, i am sharing this template .

is there another way to do that ?

@Dev2 Refer to the below post. I think the approach mentioned in the post can help to solve your requirement.

1 Like

i was checked that but i am not able to solve it but i will check that again, Thank you.

Okay got it, so you wanna get the data for the current month.

So kindly try this,

  1. Find the current month in number format as below.
int_ExcelColumnIndex = Now.Month + Now.Month - 1
  1. Find the Excel Address
str_ExcelRange = Chr(int_ExcelColumnIndex).ToString + ":" + Chr(int_ExcelColumnIndex + 1).ToString

Pass the above range calculated into the Excel Read Range - Range property.

Hope this helps.

Thanks
#nK

Thank you @Nithinkrishna

Pass the above range calculated into the Excel Read Range - Range property.

can you please clarification this point.

1 Like

Hey @Dev2

You have Read Range Activity for workbook or Excel right - In that there is a Range field where you can provide the range to read in which you need to pass the above dynamically calculated variable.

Hope that helps.

Thanks
#nK

1 Like