It will help you to find out last row count, column count then you can easily loop through your data according to requirement. Let's suppose your Excel contains blank cells then there is a different Code for that, you can easily use this in Visual Basic of Excel and Execute that in UiPath using activity Execute Macro.
***LastRow****
Range("A1").Select / Cells(1,1).Selectlastrow = Range(Selection, ActiveCell.End(xlDown)).Rows.Count
lastrow = ActiveSheet.UsedRange.Rows.Count
***LastColumn***
Range("A1").Select / Cells(1,1).Selectlastcol = Range(ActiveCell.End(xlToRight), Selection).Columns.Count
lastcol = ActiveSheet.UsedRange.Columns.Count
***LastRow With Spaces***
xIndex = Application.ActiveCell.ColumnxRowIndex = Application.ActiveSheet.Cells(Rows.Count, xIndex).End(xlUp).Row
Range(Cells(1, xIndex), Cells(xRowIndex, xIndex)).Select
lastrow = Selection.Count
***LastCol With Spaces***
xIndex = Application.ActiveCell.RowxColIndex = Application.ActiveSheet.Cells(xIndex, Columns.Count).End(xlToLeft).Column
Range(Cells(xIndex, 1), Cells(xIndex, xColIndex)).Select
colCount = Selection.Count
very nice and provide me informative content thanks for sharing for more information Looking for the best Create new worksheet
ReplyDelete