+ Reply to Thread
Results 1 to 3 of 3

Inserting Formula IFERROR

  1. #1
    Registered User
    Join Date
    04-26-2012
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    7

    Inserting Formula IFERROR

    The codes that I have is as per below, I am trying to insert a formula in a range of cells.....help anyone

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor wallyeye's Avatar
    Join Date
    05-06-2011
    Location
    Arizona
    MS-Off Ver
    Office 2010, 2007
    Posts
    308

    Re: Inserting Formula IFERROR

    I see a couple of things. First, you should probably assign the text to the .Formula property rather than to the .Value property. Second, the end of the IfError formula should look like ",0)" rather than ");0".

    You might be able to save yourself a bit of time, letting Excel do some of the work for you. Rather than using a loop to assign the formulas, assign the formula to the entire range:

    Sheets("CC_ECR_RAW").Range("FW5:FW" & (sht+4)).formula = "=IFERROR(AI5/AU5,0)"

    Excel is pretty smart, I think it will autoadjust the formula as it goes down.

  3. #3
    Registered User
    Join Date
    04-26-2012
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Inserting Formula IFERROR

    Quote Originally Posted by wallyeye View Post
    I see a couple of things. First, you should probably assign the text to the .Formula property rather than to the .Value property. Second, the end of the IfError formula should look like ",0)" rather than ");0".

    You might be able to save yourself a bit of time, letting Excel do some of the work for you. Rather than using a loop to assign the formulas, assign the formula to the entire range:

    Sheets("CC_ECR_RAW").Range("FW5:FW" & (sht+4)).formula = "=IFERROR(AI5/AU5,0)"

    Excel is pretty smart, I think it will autoadjust the formula as it goes down.
    Hi wallyeye, I used ";0" because my excel for some reason, formula uses ; instead of "," but after running the code, it changed automatically to ";" but it does work, I did user a formula rather than value but didnt change the ";" to ",". Missed that...

    Learning new things everyday

    This forum is awesome!!!!

+ 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