Champak Posted October 18, 2023 Posted October 18, 2023 Is there a simple function that will delete excess rows from an excel file?
water Posted October 18, 2023 Posted October 18, 2023 Please define “excess rows“. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Champak Posted October 18, 2023 Author Posted October 18, 2023 I really don't know how to define it. I have a web application that imports a list. If I don't right click and delete all rows after the last product I get an error on importing. I suspect they are "empty ACTIVE rows"...I guess that's how I'd define "excess rows".
Andreik Posted October 18, 2023 Posted October 18, 2023 In Excel you don't really delete rows but data in a specific range. For this you can use _Excel_RangeDelete() but no matter how many rows you delete a worksheet will always have the same number of rows and columns.
Champak Posted October 18, 2023 Author Posted October 18, 2023 (edited) I get technically the rows are "never ending". The point is to delete everything that select all would get. That's what I have to do to prevent the error that I get. I hit select all, unselect the rows with the actual data, right click and hit delete. How can I do something like that within autoit. Or maybe I can find the last row with actual data, and from there on (I'm assuming like select all) delete. Edited October 18, 2023 by Champak
Andreik Posted October 18, 2023 Posted October 18, 2023 (edited) 1 hour ago, Champak said: Or maybe I can find the last row with actual data, and from there on (I'm assuming like select all) delete. That's exactly what I was think. Or you can use _Excel_RangeFind() or _Excel_RangeRead() to get empty cells or whatever is not valid data according to your definition and then _Excel_RangeDelete() to delete the content of these cells/rows/columns. Edited October 18, 2023 by Andreik
water Posted October 18, 2023 Posted October 18, 2023 Please have a look at the wiki about Excel Ranges. Select the needed Range and loop from the end to the first row holding valid data. Delete all rows holding no/ invalid data. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now