Range and Headers on Excel Question

Hello,

I am trying to find out a better way for the bot to read the entire range of a column and drag a formula to the last known row. In the picture you can see that I set it to a specific range but in the future the excel will have more or less rows and I would like it to automate that process instead of me putting in the exact row numbers every month. Any suggestions?

Also, after creating a column, how can I title the header? I’ve tried type in cell activity and it will go to the wrong cell. Thank you for your help.

You may try “GetLastRow” activity from “Excel Extension Activities” package

https://go.uipath.com/component/excel-extension-activities

Cheers

It seems like using this activity is also asking for the last row to be typed in manually. Is there any way to automate it? Also how can I make a header when inserting a new column? Thanks for the help.

By using Read Range You will get entire data
then by using
RowCount=Datatable.Rows.Count you will get total rows count excluding headers (note : if read range Add headers is checked) so for that RowCount=Datatable.Rows.Count+1
So Just apply that formula on say D2 then by using Autofill Range
give source as
D2 and destination as “D2:D”+RowCount
so it will apply that formula to till last row

As you know where u are adding this column means location
You can use write cell to give header name
say if you insert at loc 1 then write cell in A1

Thank you! Would you how to fix the range problem? I’m trying “last row”, “read range”, “select range” etc. I can’t get it to read the number of rows in one column and do an output so when I put a formula in a new column it can auto fill to the last row of the workbook.

Use read range For that sheet which rows count you want—say Datatable
then use
assign say rowsCount=Datatable.rows.count+1 ----------RowsCount datatype is Integer

AddColumn.xaml (7.6 KB) New Microsoft Excel Worksheet.xlsx (7.8 KB)
hope it will help you

Thank you so much @ImPratham45 and @J0ska ! This absolutely helped out and was able to get the correct number of rows automatically.

I just tested and the “GetLastRow” activity does exactly what its name announce - it returns in “RowNumber” output property the index of last non-empty row.

image

Cheers