Write Cell in Excel for dynamic row number

Hi,

I have the below string-
“This string should be written in excel”

Now, i need to split the string with “” and write each word in excel sheet in different consecutive rows like A1,A2

in Write Cell activity, what should be the ‘range’ value?

1

@Saikat_Chowdhury

  1. First you need to split the given String based on space as delimiter like below.

         arrStr [] = inputStr.Split(" "c)
    
  2. The above expression will give output as Array of String. And then use ForEach loop activity to iterate that array.

       ForEach item in arrStr
             Int Count = 2
                 Use Write Cell activity and mention Range and value as below
                 Count = count + 1
    

Value: item
Range: “A”+Count.ToString

3 Likes

In this case, how the iteration will happen from 1 till the no of words?

@Saikat_Chowdhury

Here, you want to start writing value from cell A2 right. That’s why I assigned 2 to Count variable.

And also here we are using loop right and it will iterate till no. of words in that String.

Just apply that logic and try once. It should work.

1 Like

Thanks a lot. Its working! :slight_smile:

2 Likes

@Saikat_Chowdhury

Glad to help you. Happy Automation :slight_smile:

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