cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete Top 10 rows from Excel

MohiniShelke
Level 4
Hello All, 
I want to delete Top 10 rows from Excel and get it into new excel. 

I don't want these in collection because we have around 20000 data in Excel, And collection will take more time to write data into Excel. 

Please let me know the solution for this if anyone knows. 


Thanks in advance

------------------------------
Mohini Shelke
RPA Developer
vElement It
------------------------------
3 REPLIES 3

AndrewRandolph
Level 4
Now when you say delete the top 10 rows, do you mean directly within the application, cut and paste onto new spreadsheet? Are you wanting to save that anywhere specifically in a collection or file path? Also can you explain the 20,000 data in excel is this per row meaning columns of data or the amount of total rows?

------------------------------
Andrew Randolph
Analyst
Accenture
America/New_York
------------------------------

If you want to do that in excel application. I suggest you try to add this code below to your MS EXCEL VBO. 

range = sheet.Rows(Reference)
range.EntireRow.Delete

Or you can just use the default "MS EXCEL VBO - Select" and "MS EXCEL VBO - Delete" to achieve what you want to do.


------------------------------
Chenglung Tsai
Consultant
Avanade
------------------------------

AndrewRandolph
Level 4

Hey Mohini,

Take a look at the object definition for the excel VBO in blue prism and search for 1.10 Copy and Paste Worksheet Range to research how to copy and paste certain rows from one worksheet to another in excel. You can then delete the rows after the copy and paste has completed. Let me know if that makes sense, I can explain further



------------------------------
Andrew Randolph
Analyst
Accenture
America/New_York
------------------------------