Delete top 3 rows in excel


#1

HI Team, I want to delete top 3 rows in excel using Ui PAth, i have searched related topics in this forum, but i didnt understand . It will be very helpful can any one send me xaml example or if any one explains me little bit clear. Thanks in advance.


#2

Hi there @rakeshadn,
There are a few ways to achieve this, the easiest is likely to be:

  • Read the Worksheet (Excel Read Range Activity)
  • Add the Rows after Row 3 into a new DataTable (For Each with a Counter)
  • Write the acquired DataTable back to the Worksheet (Excel Write Range Activity)

Thanks,
Josh


#3

Thanks JDavey,Is there any easier way to delete top rows, i dont want to do copy and paste by using select rage activity, i just want to delete the top 3 rows in the current sheet.


#4

Hi there @rakeshadn,
As far as I am aware, there is no activity to delete rows within a Worksheet.

As noted above, the solution that immediately springs to mind is to acquire the data, manipulate it and rewrite it.

With that said, you could do the following:
Select Range Activity (RowNumber:RowNumber)
Send Hotkey (CTRL + ‘-’)

As shown below:
image

Thanks once again,
Josh


#5

Thanks a lot for your quick turnaround and help. i followed the above scenario, it solved my problem. Thanks once again