How to add number to rows.count function

I want to make the range in a Read Range activity dynamic by specifying the range by using variables.
Example: Read range -> “E1:E”+DT.rows.count.toString
That works fine. But I want the range to add 1 row to the count. Something like this:
“E1:E”+DT.rows.count.toString +1

But the number just adds 1 to the string so I get a too high number. (f.ex if I have 10 rows, and I want to add 1 I get 101 instead of 11).

I also tried to include the addition in the rows.count, like this: DT.rows.count+1
But that does not work either.

Does anyone have a solution for this?
Would be highly appreciated :slight_smile:

1 Like

@skandi

try like this below

“E1:E”+(DT.rows.count+1).ToString

if you do “E1:E”+DT.rows.count.toString +1,
it means you are adding a string + string + integer, that gives
“E1:E”+“10”+1
E1:E101

So first you need to do sum then convert that sum into a string like
“E1:E”+(DT.rows.count+1).ToString => this gives you “E1:E” + (10+1).ToString() = “E1:E10”

2 Likes

Thank you @ravisangam and @Manjuts90.

It works as intended now. The solution is what you described and it is quite obvious. I should have known that I needed to add parenthesis. Anyways, thanks for the quick reply :slight_smile: