+ Reply to Thread
Results 1 to 8 of 8

Application.WorksheetFunction

  1. #1
    Registered User
    Join Date
    09-14-2022
    Location
    Lagos, Nigeria
    MS-Off Ver
    Microsoft Office 2013
    Posts
    2

    Application.WorksheetFunction

    What is the procedure to resolve the following issue:

    Run-time error '1004':
    Unable to get the VLOOKUP property of the WorksheetFunction class

    Clicking on Debug highlighted the following line of code
    Me.txt_Rate.Value = Application.WorksheetFunction.VLookup(Me.cmb_Product, sh.Range("B:D"), 2, 0)

    Any assistance wil be highly appreciated.

    Kind regards.
    Last edited by Akinbode; 09-14-2022 at 03:56 AM.

  2. #2
    Forum Expert CheeseSandwich's Avatar
    Join Date
    12-22-2021
    Location
    Kent, England
    MS-Off Ver
    365 - 2402-17328.20068
    Posts
    1,361

    Re: Application.WorksheetFunction

    Just a guess:
    Please Login or Register  to view this content.
    Is the value there to be found or could it be missing?
    If things don't change they stay the same

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Application.WorksheetFunction

    Please see yellow banner on how to post a sample workbook.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Application.WorksheetFunction


    As WorksheetFunction is useless except to crash the procedure, remove it
    and use a Variant variable then check the result via IsError for example ...

  5. #5
    Registered User
    Join Date
    09-14-2022
    Location
    Lagos, Nigeria
    MS-Off Ver
    Microsoft Office 2013
    Posts
    2

    Re: Application.WorksheetFunction

    Thanks for the response. The record actually added to the required excel worksheet. But the error keep coming up each time a new record is added.

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Application.WorksheetFunction


    Keep Application, remove WorksheetFunction. and check the result ...

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

    Re: Application.WorksheetFunction

    There is a difference between WorksheetFunction.VLookup and Application.VLookup.
    If the search term is not there, WorksheetFunction.VLookup causes a VB error and crashes, like your situation.

    But Application.VLookup will not crash, it will return a value of data type Error


    Please Login or Register  to view this content.
    Last edited by mikerickson; 09-14-2022 at 07:39 AM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Application.WorksheetFunction


    Like post #4 ...

+ 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] using application.WorkSheetFunction. in code
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-22-2017, 06:09 AM
  2. using application.WorkSheetFunction. in code
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2017, 07:41 AM
  3. [SOLVED] Application.WorksheetFunction vs Application.NormDist
    By Boo123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2014, 06:33 PM
  4. Application, WorksheetFunction or both?
    By Benni in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2012, 08:59 PM
  5. Application.WorksheetFunction
    By roger09 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2011, 09:07 AM
  6. Application.WorksheetFunction.CountIF
    By krsna83_pp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2011, 08:27 AM
  7. [SOLVED] application.worksheetfunction
    By Ozgur Pars in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2006, 03:15 AM

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