I'm VERY new to writing macros and have used forums like this one to piece together a pretty lengthy macro to clean up a spreadsheet. It is pieced together with various AutoFilter commands to find what I don't want and delete it. I am stuck after a piece of the macro that tells the spreadsheet to subtract two dates in two different columns and put the answer (Days Between Logs) in a new column:
That part works fine. My problem comes when I try to filter that Days Between Logs column. I need to find any row that has less than 334 days and delete it. I've tried AutoFilterMode as well as an If function. Whenever I run either, all of my rows get deleted and the macro gets stuck in a long cycle. When its done running, the Number of Days column has zeros all the way down and every other row and column is empty. I tried:
and I also tried:
I tried converting the Number of Days column to a number instead of leaving the formula. I also noticed that I have an error in that column saying that its an unprotected formula.
Is there something simple I'm missing that's causing my command to delete everything?
Bookmarks