Results 1 to 2 of 2

error 1004 unable to get the vlookup property of the worksheet function class

Threaded View

  1. #1
    Registered User
    Join Date
    01-20-2013
    Location
    norwalk, ct
    MS-Off Ver
    2010
    Posts
    6

    error 1004 unable to get the vlookup property of the worksheet function class

    I am trying to use the worksheetfunction.vlookup to work. I have a sheet with 2 columns, column 1 has dates in mm/dd/yyyy format, column 2 has 5 decimal numbers. below is the function & cell entry I use to call it. I have two questions:

    1. I get the error 1004 unable to get the vlookup property...
    2. when I begin typing the function into the cell, none of the agruements appear in the intellisense. Any help will be appreciated

    =ReturnCalcTest(a10,a2,$a1:$b80)

    Public Function ReturnCalcTest(EndDate As Date, BeginDate As Date, LookupRange As Range) As Double
    
    Dim UVe, UVb As Double
    Dim i As Integer
    
    i = DateDiff("yyyy", EndDate, BeginDate)
    UVe = Application.WorksheetFunction.VLookup(EndDate, LookupRange, 2, False)
    UVb = Application.WorksheetFunction.VLookup(BeginDate, LookupRange, 2, False)
    
    If i < 1 Then
        ReturnCalcTest = ((UVe / UVb) - 1) * 100
    Else
        ReturnCalcTest = (((UVe / UVb) ^ (1 / i)) - 1) * 100
    End If
    
    End Function
    Moderators Note: Please follow Forum Rule #3 and use code tags. Added this time, but please use them in the future…Thanks.
    Last edited by jeffreybrown; 01-20-2013 at 04:39 PM.

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