+ Reply to Thread
Results 1 to 9 of 9

Find Min Value Error (91)

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Find Min Value Error (91)

    Hi all,

    in an addin, i have the following simple code:

    Please Login or Register  to view this content.
    If the cells are numbers with a decimal point the code struggles to select the cell and returns an error instead(91 - with block variable not set).

    I tried lookin:=xlFormulas/Values but had no luck.

    Anyone got a clue what I should change here? Thanks
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Find Min Value Error (91)

    Maybe the selection is just empty cells?
    That way minVal will be 0 and rngMin will be Nothing. So rngMin.Select will throw the error you mentioned.

    I've tested it with some numbers and it works for me.

  3. #3
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Find Min Value Error (91)

    Hi RHCPgergo! Thanks for your fast reply. Sadly the problem lies in something else. I wanted to attach a file but am unable due to internet restrictions at my workplace.

    Please try to find the max value of those three numbers:

    151.369424650939 142.999500243784 173.81723803147

    The error should pop up.

    Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Find Min Value Error (91)

    Still works, both Min and Max.
    Maybe your numbers are not recognized as numbers by excel? They may be recognized as text. (If they are aligned right, they are probably numbers. If aligned left, then it is text.)

  5. #5
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Find Min Value Error (91)

    Sadly those are numbers in my case as well :/ Pretty weird that the same code works for you, while it doesnt for me... Min works - max doesn't.
    Thanks for your help anyway! If anyone can come up with a reason why it wont work at my side, then please let me know

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find Min Value Error (91)

    cells are numbers with a decimal point the code struggles
    Please share that Number on which the code fails for testing purpose


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  7. #7
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Find Min Value Error (91)

    In the OP you said that Min doesn't work. So what did you do that it works now? :P

    edit: question is directed at Bishonen
    Last edited by RHCPgergo; 02-15-2013 at 05:44 AM.

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find Min Value Error (91)

    Quote Originally Posted by RHCPgergo View Post
    In the OP you said that Min doesn't work. So what did you do that it works now? :P
    The above message is for whom?

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Find Min Value Error (91)

    After the declaration of the variable add this code and try....

    Please Login or Register  to view this content.
    Awaiting for the feedback

+ 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