I have a spreadsheet where in one column I calculate days since creation. When this spreadsheet is compiled, I want to delete any row which has a number of less than 40.
So Column N has a header of ‘Days Since Creation’. I want to find any cell in this column with a value of 39 or less and then delete the entire row in which this is held.
U could read the spreadsheet to a Data Table.
After that, iterate through the Data Table and make the verification. If the number is less than 40, store the index of row and add 1 to the index. After this u could delete the row in excel with this index
hello @thetruestorey
If you are sure column ‘Days since creation’ will contain only number the try below
read your file in datatable dt
dt.Select(“Convert([Days since creation],‘System.Int32’) > 39”).CopyToDatatable
you can then output this dt into new file or override the existing sheet’s data.
So if I Read Range and extract it to dt for example, would I then do a ‘for each’ with ForEach row in dt then ‘Get Row Item’ followed by an ‘If’ or am I way off?