+ Reply to Thread
Results 1 to 4 of 4

Can't divide by 0 vba error

  1. #1
    Forum Contributor
    Join Date
    01-21-2021
    Location
    Leeds
    MS-Off Ver
    2016
    Posts
    236

    Can't divide by 0 vba error

    Hi,

    Thanks for looking at my post.

    I have below formula in the VBA. Sometimes i will have Textbox5 as "0". In this case obviously i am getting an error as cannot divide by 0. Is there any possiblity to tweek vba code so that we can avoid vba error and give result as 0 instead of vba error please?

    HTML Code: 

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Cant divide by 0 vba error

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    01-21-2021
    Location
    Leeds
    MS-Off Ver
    2016
    Posts
    236

    Re: Can't divide by 0 vba error

    Thanks a lot for quick reply

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Can't divide by 0 vba error

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Divide by zero error
    By Sue70 in forum Excel General
    Replies: 2
    Last Post: 12-09-2014, 11:26 PM
  2. [SOLVED] Divide by zero error
    By rutica in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-25-2013, 08:17 PM
  3. [SOLVED] Divide by 0 error 13
    By Dalton626 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2013, 05:28 PM
  4. Divide 0 error
    By mojobaabby in forum Excel General
    Replies: 10
    Last Post: 10-23-2010, 02:59 AM
  5. Divide by Zero Error
    By AllenMead in forum Excel General
    Replies: 5
    Last Post: 09-22-2010, 08:36 AM
  6. Divide by zero error
    By dale.harrison in forum Excel General
    Replies: 1
    Last Post: 10-02-2009, 09:27 AM
  7. divide by zero error...
    By doublejoy in forum Excel General
    Replies: 12
    Last Post: 08-22-2009, 06:16 PM

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