How to reference a row in excel with a variable using modern activities

Hello, I would like to copy a range from an Excel workbook up to a certain row that may change daily. I can extract the row number however I am not sure how to use it in the copy/paste range function.

I would like to accomplish something to the extent of the following:

int rowcount = last row to select

Copy/Paste Range

Source:
Excel.Sheet(“Report”).Range(“A1:AE(row count)”)

Destination:
Excel.Sheet…

So if rowcount = 10 than I want to select A1:AE10.

Is there a way to accomplish this?

Thank you!

@fmarcin11

you need to give like this

Excel.Sheet("Report").Range("A1:AE" + rowcountVariable.ToString)

cheers

Hello @Anil_G, this is exactly what I needed and it worked perfectly! Thank you!!

1 Like

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