How do i extract values in a String?

  • Hi Trippy,


    I found some code at https://stackoverflow.com/ques…ind-numbers-from-a-string and had a play to create some UDFs. The code and attachment is below. Although what I have done works on the ranges you gave me it has a couple of shortfalls I have not been able to rectify, maybe someone else here could fix them - if you have two high values of the same magnitude in the list it will fail, I assume the same for low value. I will have another look later but am not hopeful.


    There are three UDFs, "OnlyHigh", "OnlyLow" and (MaxHVals) - OnlyLow the use of each is demonstrated on the attachment. You will probably find some bugs in them, just post back when they pop-up. They should all work for kHz, MHz, GHz and THz.




    JDEDIT - RangeCal.xlsm

  • Just found that if you insert

    Code
    1. On Error Resume Next

    in the code for each of the UDFs I think it fixes the problem if same values are found.

    option explicit is not set as noted in the code - could cause an issue or two as things not declared fully/correctly


    Make sure you correctly turn on error back 'on', what that code does is ignore errors


    jiuk