+ Reply to Thread
Results 1 to 3 of 3

Thread: I need a way to reset some formulas as part of a maintenence function

  1. #1
    Registered User
    Join Date
    01-20-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    24

    I need a way to reset some formulas as part of a maintenence function

    =IF(Active!A3=0, "", Active!A3)
    =IF(Active!A4=0, "", Active!A4)
    So here is the problem, I have a sheet that is for printing data from page active. As it stands the formula above works fine (those two formulae are for A3, and A4 of my Printing worksheet. All the other cells are vlookups off the value in the cell in the A column. Annoyingly, when I delete a row from my spreadsheet, rather than simply referring to the NEW A3, it breaks the reference. (if its possible to just prevent that from happened so much the better).

    The only way I can think of to fix this is to fold into another maintenence macro, a loop that goes through and makes the formula equal what it is supposed to for A3 to A50, but I'm not actually sure how to do that because the cell references are to another table. I don't want to try and do any kind of function IN the macro (although if I have to I have to). I just want the cells to have that formula in them with the correct references rather than #REF.

    Any ideas?

    To clarify, this MIGHT have a function fix (and I'd take that), but what I'm specifically looking for is the VBA to insert =IF(Active!A3=0, "", Active!A3) into A3, =IF(Active!A4=0, "", Active!A4) into A4, etc down to A50.
    Last edited by scantron; 02-03-2012 at 11:37 AM.

  2. #2
    Forum Moderator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    4,399

    Re: I need a way to reset some formulas as part of a maintenence function

    Why do you delete rows? How about just clearing contents instead of deleting the rows?
    Cheers,
    Arlette

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: I need a way to reset some formulas as part of a maintenence function

    A few options:

    =IF(INDEX(Active!A:A,row())=0, "", INDEX(Active!A:A,row()))

    or if Active column A contains text:

    =INDEX(Active!A:A,row())&""

    or VBA
    Range("A3:A50").Formula = "=IF(Active!A3=0, """", Active!A3)"
    Good luck.

+ 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.2.0