Results 1 to 2 of 2

Sub Function

Threaded View

  1. #1
    Registered User
    Join Date
    10-18-2018
    Location
    London
    MS-Off Ver
    2013
    Posts
    4

    Sub Function

    Hi all,

    I am trying to write a new function (myVLookup) without using "VLOOKUP" function.

    I currently have 2 columns (A and B). If someone uses the abbreviation =myVLookup(i) in excel, where i is an element of column B, this formula need to return to him the element from column A. (same row, different column - I have used Offset??)

    Function myVlookup(i) As Variant
    
    Dim max As Single
    Dim min As Single
    
    Dim rng As Range
    
    max = Application.WorksheetFunction.max(Range("b:b"))
    min = Application.WorksheetFunction.min(Range("b:b"))
    
    Set rng = Range("A1:B3")
    
    For i = min To max
    
    myVlookup(i) = Offset(0, -1)
    
    Next i
    
    End Function
    
    Please can someone have a look and help if possible??????

    Many thanks,
    Christina
    Last edited by Christina22; 11-10-2018 at 05:48 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 07-07-2018, 04:13 AM
  2. COUNTUNIQUE Function in Google Sheets; Excel lacks a direct counterpart to this function?
    By PivotTablePSHomage in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2018, 05:27 AM
  3. Replies: 3
    Last Post: 08-14-2017, 06:26 AM
  4. Replies: 2
    Last Post: 04-23-2017, 12:04 AM
  5. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  6. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  7. Replies: 1
    Last Post: 03-21-2012, 11:22 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