+ Reply to Thread
Results 1 to 3 of 3

XLookup Max not working in VBA

  1. #1
    Registered User
    Join Date
    06-17-2021
    Location
    Washington, USA
    MS-Off Ver
    Current
    Posts
    19

    XLookup Max not working in VBA

    The formula I need to use is an XLookup(Max format, however it doesn't translate to my application.XLookup function in VBA.

    I have tried this:

    Please Login or Register  to view this content.
    However, it is saying the MAX sub is undefined. Is there a different function or application I should be using?

    Crossposted at stackoverflow.com/questions/76096591/how-do-i-translate-my-xlookup-max-formula-to-vba

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: XLookup Max not working in VBA

    Max is not a VBA function. Use Application.WorksheetFunction.Max. You should also use Application.WorksheetFunction.XLookup.

    I think your parentheses may not be correct. Xlookup requires three arguments and you have only given it one. Everything in Xlookup is inside the Max function. Look at it like this:
    Please Login or Register  to view this content.
    I can't fix it because I don't know what you want it to do.
    Last edited by 6StringJazzer; 04-24-2023 at 07:49 PM.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    06-17-2021
    Location
    Washington, USA
    MS-Off Ver
    Current
    Posts
    19

    Re: XLookup Max not working in VBA

    Please Login or Register  to view this content.
    is the lookup value.
    Please Login or Register  to view this content.
    is the lookup array.
    Please Login or Register  to view this content.
    is the return array that I want the max value from. Does that make sense?

+ 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. Replies: 6
    Last Post: 03-11-2023, 10:13 AM
  2. Replies: 1
    Last Post: 02-15-2023, 03:28 PM
  3. XLOOKUP Equivalent when working with Data Model (to return array of results)
    By chris01395 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-27-2022, 10:00 AM
  4. If this do this XLOOKUP otherwise do this XLOOKUP
    By MattKoleczko in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-21-2022, 08:14 AM
  5. XLOOKUP not working as well with sharepoint files
    By twaccess in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-28-2021, 05:31 AM
  6. Two-way Xlookup
    By Ballet4ever in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2021, 10:11 PM
  7. [SOLVED] Mutil-critieria XLookUp with range is concacted together - not working
    By stearno in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-08-2020, 06:29 AM

Tags for this Thread

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