+ Reply to Thread
Results 1 to 7 of 7

How to Use XLOOKUP In VBA

  1. #1
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    How to Use XLOOKUP In VBA

    I have a datasheet that contains many cells that receive data from an SQL query.

    The data arrives in 'text' format.

    To perform numerical comparison, I convert the data to numeric, after doing so, the value goes to decimal format.

    Depending on the result, determines the format I want to apply.

    Data Sheet:
    COL-A = Unit Number
    COL-B = System Name
    COL-C = Analysis Name
    COL-D = Sample Date/Time
    COL-E = Oldest Result
    COL-F = Second Oldest Result
    COL-G = Most Recent Result

    Another sheet retains the formatting information
    COL-A = Unit Number
    COL-B = System Name
    COL-C = Analysis Name
    COL-D = Assigned Format

    I am trying to use XLOOKUP to reformat the newly converted text-to-value. See the modSupportCode VBA sheet.

    Any assistance is truly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: How to Use XLOOKUP In VBA

    Probably easier to use a dictionary in this case for the lookup since you want multiple criteria:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    Re: How to Use XLOOKUP In VBA

    Thank you. The Lookup_Value returns as empty?

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: How to Use XLOOKUP In VBA

    Oh. I tested this on my Excel before posting. Everything got formatted correctly. Is this on Windows?

    WBD

  5. #5
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    Re: How to Use XLOOKUP In VBA

    Yes, Windows 10 Enterprise, using 365 Excel.

    I'll try again.

  6. #6
    Forum Contributor
    Join Date
    10-25-2010
    Location
    Phoenix, Arizona, USA
    MS-Off Ver
    O365
    Posts
    202

    Re: How to Use XLOOKUP In VBA

    I have copied the entire post you provided, IT DOES WORK!

    Thank you.

  7. #7
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: How to Use XLOOKUP In VBA

    Cool. You might want to update your profile to reflect the version of Excel that you're using

    WBD

+ 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. [SOLVED] XLOOKUP gives N/A
    By Hexdax in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-23-2022, 04:06 AM
  2. [SOLVED] if and xlookup
    By pickslides in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-16-2022, 07:24 AM
  3. 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
  4. [SOLVED] Xlookup in PQ
    By Excelski in forum Excel General
    Replies: 7
    Last Post: 09-09-2021, 07:15 AM
  5. Two-way Xlookup
    By Ballet4ever in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2021, 10:11 PM
  6. [SOLVED] Xlookup with VBA, need some help!
    By CSimm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-19-2021, 03:14 PM
  7. Xlookup & sum
    By lynusann in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-19-2020, 11:04 PM

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