I have been taking some VBA course from the Excel for Business web site and created a user defined function called ULookup. The function works fine in the spreadsheet and if I use the = sign, the Ulookup will show up. However, Control-Shift-A does not show the complete fill in hints like it does on a PC and if I go to the insert function menu, the function will not show up at all. Is this a bug in the Mac version of Excel or is am I missing something? Here is the code that I put in Module 1 of myWorkbook:
Option Base 1
Function ULookup(lookup_value As Range, lookup_range As Range, source_range As Range, Optional match_type As Integer = 0) As Variant()
' Performs an Index / Match Lookup.
Dim results_Array() As Variant
Dim lookup_index As Long
ReDim results_Array(1) As Variant
' Consider defining this as an array function
' Dim lookup_value ' Contains the value I want to find
' Dim lookup_range ' Range to search in
' Dim source_range ' Pull corresponding value from
' Dim match_type ' Consider the type of match to perform, exact, lesser, greater
' Find lookup_value in lookup range
lookup_index = Application.WorksheetFunction.Match(lookup_value, lookup_range, match_type)
' Determine if lookup value was in the range.
' Get corresponding value from source range
results_Array(1) = WorksheetFunction.Index(source_range, lookup_index)
' Do not edit code beyond this comment
ULookup = results_Array
End Function