+ Reply to Thread
Results 1 to 4 of 4

Add Condition To Macro

  1. #1
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Add Condition To Macro

    I have been using this macro:

    Please Login or Register  to view this content.
    To find the "Total" row and delete columns D:O that show a zero. Macro works great, but I would like to add a condition that makes the macro only delete the columns if the date in row 7 is greater than today (or the month is greater than the current month.
    I supplied an example. Thanks for the help.

    ps
    This question was posted as a follow up at:
    http://www.mrexcel.com/board2/viewto...988&highlight=
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Use an If statement before your delete statement

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    thank you very much for your reply.
    The code however, has a compile error saying wrong number of arguments or invalid property assignment. It highlights the word "Format".

  4. #4
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Not sure why it isn't working for you it seems to be running fine for me.

    Make sure you have copied it exaclty and aren't missing any parenthesis on that line.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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