+ Reply to Thread
Results 1 to 8 of 8

VBA for searching the max value

  1. #1
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    VBA for searching the max value

    Hi!

    Im looking for a VBA code so that each time I initialize my userform, appears in TextBox1 the maximum value from the Range(A9:till the last value entered) located in Sheet3

    Thanks for the help!

    Regardss

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: VBA for searching the max value

    Try
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: VBA for searching the max value

    Hello!

    I didnt manage to make it work...
    I think I better attach the file, that would make it easier.

    What Im looking for is:

    In UserForm "STOPS" ---> TextBox "T1"

    I would like to display here the MAX Value +1 of the data stored in Range(A9:till the end from Sheet Trips Overview
    And if there is no data in that Range then make T1 = "N/A"

    Any help would be much appreciated. Thank you!

    Regards
    Attached Files Attached Files

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: VBA for searching the max value

    What do you mean doesn't work?

    Try
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: VBA for searching the max value

    Hi mikerickson,

    First of all thanks for your help and attention.
    I inserted the code but it always returns the value "0" (N/A in this case).

    In Range(A9:A65536) the max value is 3 in this situation and doesnt return that value...

    Regards

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: VBA for searching the max value

    The data is column A is formatted as text, which always plays havoc with a worksheet.
    Try
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: VBA for searching the max value

    mikerickson!!

    Thanks man! Running great and as I wanted!


  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: VBA for searching the max value

    You should probably track down where that number as text formatting came from and try to eliminate it.
    Column A may not be the only problem created by that.

+ 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