+ Reply to Thread
Results 1 to 7 of 7

If Statement USED to Work!

  1. #1
    Registered User
    Join Date
    08-25-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    If Statement USED to Work!

    I have been working on a large workbook with several macros. This particular macro has not gotten hordes of attention. The only modifications I have made are to extend ranges & to start in row 10 instead of row 6. Othwerwise, I have not changed it.

    It does run through the macro, produces the desired formula, but does not store the results properly. When debugging, if I view any cell with the correct formula visible, I can hit 'F2' + <enter> in excel and the desired result appears.

    I have tried changing the RC[-11] & RC[-7] references to actual cell names. This did nothing for me. Any ideas? TIA.

    Sheets("SUBSCRIPTIONS").Cells(LASTSUBSCRIPTIONSROW, 1).Value = Sheets("SETUP").Cells(2, 3).Text
    Sheets("SETUP").Select
    Range("O10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-11]=""Y"", RC[-7], 0)"
    Range("P10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-11]=""Y"", RC[-7], 0)"
    Range("Q10").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-11]=""Y"", RC[-7], 0)"
    Range("O10:Q10").Select
    Selection.Copy
    Range("O10:O220").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Application.CutCopyMode = False



    This was the original:

    Sheets("SUBSCRIPTIONS").Cells(LASTSUBSCRIPTIONSROW, 1).Value = Sheets("SETUP").Cells(2, 3).Text
    Sheets("SETUP").Select
    Range("O6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-11]=""Y"", RC[-7], 0)"
    Range("P6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-11]=""Y"", RC[-7], 0)"
    Range("Q6").Select
    ActiveCell.FormulaR1C1 = "=IF(RC[-11]=""Y"", RC[-7], 0)"
    Range("O6:Q6").Select
    Selection.Copy
    Range("O6:O120").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Application.CutCopyMode = False




    Snoops
    Last edited by Snoopy2010; 08-26-2010 at 03:28 PM.

  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: If Statement USED to Work!

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then edit your post to amend your thread title accordingly and add CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-25-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: If Statement USED to Work!

    I am not permissioned to edit my orig entry, so I re-entered it here. I hope I've complied.

    The only modifications I have made to this macro are to extend ranges & to start in row 10 instead of row 6. .

    It does run through the macro, produces the desired formula, but does not store the results properly. When debugging, if I view any cell with the correct formula visible, I can hit 'F2' + <enter> in excel and the desired result appears.

    I have tried changing the RC[-11] & RC[-7] references to actual cell names. This did nothing for me. Any ideas? TIA.
    Please Login or Register  to view this content.
    Last edited by romperstomper; 08-25-2010 at 05:45 PM. Reason: add code tags.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: If Statement USED to Work!

    You still didn't get the tags. You need to enter:
    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code]
    I have done it for you on this occasion, but please learn to use them.

    It sounds to me as though you have calculation set to manual, or do you mean that the actual formula is displayed in the cell instead of its result?
    Remember what the dormouse said
    Feed your head

  5. #5
    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: If Statement USED to Work!

    After you set calculation back to automatic, try this:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-25-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: If Statement USED to Work!

    Thanks. I will try this in the office tomorrow.

    I have a really dumb question -

    if I do the
    Please Login or Register  to view this content.
    will it supply the gray encasement that isolates the code? Sorry for not knowing.

  7. #7
    Registered User
    Join Date
    08-25-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: If Statement USED to Work!

    I guess I answered my own question

+ 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