Forum Discussion
help with deleting all rows but header when column has a cell that contains 0
- Sep 01, 2023
I guess I tried to answer in another your post https://techcommunity.microsoft.com/t5/excel/auto-fill-in-office-script-api/m-p/3915532#M203345
I cannot comment on VBA scripts, so I'm leaving all of that for somebody else. I want to ask a "big picture" question or two, if I might.
Your description is a bit confusing: you talk, for example, of wanting to delete an entire row if column D contains a zero but not being able to do filter and delete because that deletes the column. (It is entirely possible to delete rows that have been filtered, without deleting the column; hence that particular confusion).
A deeper issue, however, is what I refer to as the "bigger picture" here. If we were sitting down together, face-to-face, I would definitely, as a responsible "consultant," want to know what this spreadsheet is about. I'd need to go over with you what kind of data you're tracking, in what sort of "business"--not necessarily meaning commercial pursuit, just what is the context, the bigger purpose?
The reason for needing to know that: in general--not always, but in general--once data are collected toward some purpose, it's better for the sake of data integrity to retain the data. It might make sense to mark rows as "defunct" or "no longer applicable" but they're there as part of the history of whatever it is you're tracking.
For example, I was director of the HR/Payroll database for a major corporation. Employees often changed jobs, were promoted, transferred, put on leave, returned....but the history of each position they occupied was kept permanently, even when a new position or location superseded the prior.
Presumably, in your situation, there are data elements in columns other than 😧 by deleting the row, you're removing that part of the historical record, whatever it is that the row represents.
As noted, this may be entirely legitimate in your case, but I think it's important to ask, as one of the "consultants" you've invited to take a look at your project. So, could you provide a glimpse into that bigger picture?
And, if it's possible without divulging confidential information, if you could post a copy of the workbook on OneDrive or GoogleDrive, with a link pasted here that grants access, that too would help us help you.
- SergeiBaklanSep 02, 2023Diamond Contributor
blairwebb ,you are welcome, thank you for the clarification.