Dynamically get the Range of Column Headers

In my case, sometimes Column Headers are located in 1st row or 4th row, etc.

How do I dynamically input Range in my Read Range to get the Column Headers?

image

Hi @Shoji

Use the Find\Replace activity to find the First Column name in the excel and store the cell where it was in a variable.

→ Use the Excel Process scope activity and insert the Use excel file activity.
→ Inside Use excel file activity insert the Find\Replace activity.
→ Select the find option from the Operation dropdown, Give the Excel.Sheet(“Sheet Name”) in the Where to Search field, Give the first Column name in the Value to find field and Create a variablt to store the Cell range in the Found At Field.

→ Then in the Read Range workbook activity pass the Output variable of Find\Replace activity to the Range field.

Check the below workflow for better understanding,

Regards

1 Like

@Shoji,

Use two Read Range activity to read values. One to read first row another for 4th row.

Once you get the data, check which one have the header you desired. Once confirmed which one have the header, use that row as starting point for full data Read range.

Thanks,
Ashok :slight_smile:

1 Like

this one works, thank you @vrdabberu

1 Like

You’re welcome @Shoji

Happy Automation!!

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