Results 1 to 10 of 20

Thread: Showing Custom Value Based on the Condition of Dynamic Table

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Hi
    If you are happy with your solution and think it works consistently for you then that is fine. It is your responsibility so you should decide how to do things. That’s important.

    But note:
    Using On Error Resume Next , is in all but a few limited cases and for all but short code sections, generally regarded as very, very bad practice.
    On Error Resume Next does not stop any errors
    On Error Resume Next simply tells VBA to ignore them and keep running at the next line
    Moreover, many problems and errors may occur, but On Error Resume Next instructs VBA to keep going, and this could occasionally lead to disastrous results.

    Error handling in VBA
    Error handling in VBA is one of the most advanced subjects, and is one area that is strangely only understood by just a very few number of people. Many experts and professional programmers do not understand fully how Error handling in VBA works
    ( I am one of about half a dozen people on this planet that fully understand how error handling in VBA works.
    Anyone who understands how error handling in VBA works will only use On Error Resume Next in a very limited number of ways for very short code sections.
    I once saw a very bad error in the use of error handling at a very famous Blog site. I tried to explain the problem to this person responsible who was one of the leading VBA experts. After two weeks he could not understand the problem, and , in frustration, reluctantly removed the entire Blog page at his site! )

    At some time in the future, something unexpected and bad might occur when your macro is running. It might not be directly related to your coding. In this situation it will be very important for VBA to stop running your code and tell you in an error message what the problem is. Your use of On Error Resume Next will prevent VBA from taking the important error handling action. The code will simply keep going. This may be a very rare occurrence, but the consequences could be very serious.

    Using On Error Resume Next is like instructing a car driver to always just keep driving regardless of any problems or accidents and to simply ignore everything and keep driving regardless of all the consequences.

    In general, if it is possible, it is much better to prevent an error occurring, than to let it happen and ignore it.
    On Error Resume Next tells VBA to ignore all errors anywhere . This is very bad programming practice
    Somebody who understands error handling in VBA, will only reluctantly use On Error Resume Next to ignore a single error at a specific place in a coding if
    _a) he is 99.999% sure that he understands the error and all the consequences , and
    _b) he cannot figure out anyway to prevent that error occasionally occurring



    Never the less, the solution for a short coding might mostly work most of the time.
    Its your choice.

    Alan
    Last edited by DocAElstein; 09-16-2020 at 01:30 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Replies: 8
    Last Post: 06-01-2020, 06:13 PM
  2. Replies: 2
    Last Post: 03-18-2014, 02:29 PM
  3. Replies: 3
    Last Post: 08-15-2013, 01:00 AM
  4. Custom Charts in Excel :: Comparison RAG Chart Showing Tolerance Limits
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 06-13-2013, 09:40 PM
  5. Formula Based On Condition
    By Aryan063007 in forum Excel Help
    Replies: 4
    Last Post: 10-09-2012, 10:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •