Write Cell activity using the cell address, instead of D2, can we use (2,4)?

Hi Folks,
my use case is to put Hyperlink (to make the urls look good) in each cell for the column “FilePath”. But this column “FilePath” is dynamic (ie, it can be in col 2 or 20 or 30)
So, I got hold of the cell addres of the column header “FilePath” and now need to use a write Range activity inside a ForEachRow activity while iterating through the datatable rows.
What should I give in the Range for the “Write Range” activity? I cannot use “B” + rowIndex since I know the column position (eg, as 2 as instead of B).
Here’s my incomplete Write Range activity inside the ForEachRow loop. LOL
“Sheet1”
Range = ???
Value = “=HYPERLINK(”""+strPathVar+""","“Please Click”")"

Need to know how to put the Range ???
Any help is much appreciated.Thank you in advance.

Hi @Rudrava_Som,

If you want to put something in each cell of the column and you can’t predict column index then its better to make use of column index.

I’ll suggest you to follow the steps below,

  1. Read Range activity to take excel sheet data into DataTable var. (DT)
  2. Take For Each Row activity on DT to iterate through each cell.
  3. Take Assign inside for each row as given below.

row("FilePath") = "your formula"

—> By the end of for each row loop all the hyperlinks (formula) are assigned to each cell.

  1. Take Write Range activity outside and after the for each row. to write DT in another sheet to conform the output. That’s it.

Thanks Samir for your prompt response. This looks good. Thank you so much.
Also, I saw another post on this similar topic where the column number is converted to the alphabets. Please refer to the below link.


Excel_Column_Name_mapping.xaml

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