+ Reply to Thread
Results 1 to 3 of 3

Deleting Rows Inside a macro

  1. #1
    Registered User
    Join Date
    01-17-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    67

    Deleting Rows Inside a macro

    Hi Folks,

    I have a formula that counts how many rows there are in cell A, then fills the rest of the columns down to match. It works using the "selectionchange" part of the worksheet, and executes perfectly 99% of the time.

    Unfortunately, there is a program that fills the data in column A and sometimes the rows in A decrease, but the macro still fills down to the old number of rows, causing excel to divide by zero a few dozen times and crash.

    So is there a way that I can have it fill down ONLY if the row is not empty? The code is below

    Please Login or Register  to view this content.
    I think I need something just before the

    Please Login or Register  to view this content.
    line but I'm not sure what.

    Can I nestle an IF function in there? Or should I end the with... one line early, run the IF, and then finish off the IF function?

    Many thanks for your help,

    AR

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Deleting Rows Inside a macro

    Maybe like this, but if can wipe out all the formulas in col F depending on what you do in col A:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-17-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Deleting Rows Inside a macro

    Quote Originally Posted by shg View Post
    Maybe like this, but if can wipe out all the formulas in col F depending on what you do in col A:
    Hey, thank you, what do you mean it can wipe out all the formulas in col F though? Col A will never be empty, so I think it should be OK... Will try tonight, many thanks,

    AR

+ 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