+ Reply to Thread
Results 1 to 3 of 3

macro is deleting everything

  1. #1
    Registered User
    Join Date
    05-02-2013
    Location
    Miami, FL
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question macro is deleting everything

    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:

    Please Login or Register  to view this content.
    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:

    Please Login or Register  to view this content.
    and I also tried:

    Please Login or Register  to view this content.
    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?
    Last edited by Leith Ross; 05-13-2013 at 04:13 PM. Reason: Added Code Tags

  2. #2
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: macro is deleting everything

    upload a sample workbook

  3. #3
    Registered User
    Join Date
    05-02-2013
    Location
    Miami, FL
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: macro is deleting everything

    I just started over. I think its going to work this time. I cleaned up the macro. If I get stuck again I'll repost. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1