+ Reply to Thread
Results 1 to 7 of 7

Replace Div/0 with 0 for a range

  1. #1
    Forum Contributor
    Join Date
    01-27-2016
    Location
    Greenville,NC
    MS-Off Ver
    Excel 2013
    Posts
    124

    Replace Div/0 with 0 for a range

    Hello,

    I have a range of data in a sheet that has some values. Some of the values have Div/0, which I simply want to replace with 0. The range is starting from E3 all the way down to the last cell with data. I figured out how to select this range, but can not figure out how to make this change. Any help would be greatly appreciated.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,417

    Re: Replace Div/0 with 0 for a range

    This means that each of these cells contains a formula. Change the first one from:

    =formula

    to:

    =IFERROR(formula,0)

    and copy down.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    01-27-2016
    Location
    Greenville,NC
    MS-Off Ver
    Excel 2013
    Posts
    124

    Re: Replace Div/0 with 0 for a range

    Ali,

    Thank you so much for your response. I did not clarify in my origianl posting, but I am trying to program this to happen for me.

    Please Login or Register  to view this content.
    VBA does not like this code and i can not figure out what all is wrong with it. If there is a Div/0 within that range, then make it 0. That is what I was intending to do.

    Thank you so much for your help!
    Last edited by rcdavis28; 03-01-2018 at 11:24 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,417

    Re: Replace Div/0 with 0 for a range

    Sorry - I didn't see the forum section you had chosen.

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

    Re: Replace Div/0 with 0 for a range

    Change Value to Text in the If statement.
    If posting code please use code tags, see here.

  6. #6
    Forum Contributor
    Join Date
    01-27-2016
    Location
    Greenville,NC
    MS-Off Ver
    Excel 2013
    Posts
    124

    Re: Replace Div/0 with 0 for a range

    Thank you Norie. That worked perfectly.

  7. #7
    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: Replace Div/0 with 0 for a range

    Alternatively,

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find and Replace within Range
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2016, 06:07 AM
  2. lookup value then replace range by range
    By asqw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2016, 10:14 AM
  3. Search from a range and replace
    By kumark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2013, 07:06 AM
  4. Trying to replace a range of values
    By quirk in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 09-14-2012, 11:17 AM
  5. VBA - Range and value match and replace
    By dakkat in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-26-2010, 10:54 AM
  6. Replace words in a given Range
    By downunderthunder in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-05-2010, 11:01 PM
  7. Replace Function Across Range
    By MartinShort in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2006, 10:42 AM

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