+ Reply to Thread
Results 1 to 5 of 5

VB Code to add Formula in Cell

Hybrid View

rizmomin VB Code to add Formula in Cell 03-24-2013, 10:37 AM
Norie Re: VB Code to add Formula in... 03-24-2013, 10:46 AM
Special-K Re: VB Code to add Formula in... 03-24-2013, 10:48 AM
rizmomin Re: VB Code to add Formula in... 03-24-2013, 10:51 AM
Norie Re: VB Code to add Formula in... 03-24-2013, 10:54 AM
  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to add Formula in Cell

    Hello:

    I need a VB Macro to copy the below formula in cell R214 to R606
    =IF(ISERROR(Q214/P214),"0",Q214/P214)

    So formula in
    R214 =IF(ISERROR(Q214/P214),"0",Q214/P214)
    R215 =IF(ISERROR(Q215/P215),"0",Q215/P215)
    R216 =IF(ISERROR(Q216/P216),"0",Q216/P216)and so on..

    Let me know if any questions and thanks for the help.

    Riz
    Last edited by rizmomin; 03-24-2013 at 10:51 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: VB Code to add Formula in Cell

    Try this.
    Range("R214:R606").Formula = "=IF(ISERROR(Q214/P214),0,Q214/P214)"
    If posting code please use code tags, see here.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: VB Code to add Formula in Cell

    Post deleted - pls ignore
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to add Formula in Cell

    Hi Notie:

    Thanks a lot...this will work for me

    Riz

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: VB Code to add Formula in Cell

    Riz

    No problem.

    Note, I removed the "" around the 0.

    If you really want them you can use this.
    Range("R214:R606").Formula = "=IF(ISERROR(Q214/P214),""0"",Q214/P214)"
    That will give you text though which could interfere with other formulas.

+ 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