LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Brian Rogge
 
Posts: n/a
Default user defined function

I am attempting to define a function that looks up a value on another
worksheet and returns that value to the active cell. Sample data is below
and the spreadsheet is attached.

Basically I want enter the meals on sheet 1 by looking up the value of
sheet1.week-day on sheet 2 and then return the entree for that value.
Currently I am using =VLOOKUP(G4,Menu,4,0). 'Menu' is the range on sheet 2.
The problem is there are 20,0000 rows on sheet 1 and the workbook is getting
large - actually there is another part of the workbook that is causing the
size problem but fixing this will help me fix the other. My attempt at the
user-defined function is listed below. It returns #Ref right now. Any
guidance would be appreciated.

R/

Brian

Sheet 1 Sheet 2
Meal Week-Day Week-Day Week # Day Entrée
Week 1-Monday Week 1-Monday Week 1 Monday Hamburgers
Week 2-Friday Week 1-Tuesday Week 1 Tuesday Hot Dogs
Week 2-Tuesday Week 1-Wednesday Week 1 Wednesday Pizza
Week 1-Thursday Week 1-Thursday Week 1 Thursday Chicken
Week 2-Thursday Week 1-Friday Week 1 Friday Stew
Week 2-Monday Week 2-Monday Week 2 Monday Pork Chops
Week 2-Wednesday Week 2-Tuesday Week 2 Tuesday Roast
Week 2-Wednesday Week 2 Wednesday Hamburgers
Week 2-Thursday Week 2 Thursday Hot Dogs
Week 2-Friday Week 2 Friday Chicken



Function last_done_date()
'returns last_done_date
VLookup = Application.VLookup
Offset = Application.Offset
last_done = VLookup(Offset(ActiveCell, 0, 1, 1, 1), Menu, 4, 0)

End Function






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
user defined function row number bj Excel Worksheet Functions 11 March 9th 05 01:31 PM
Attaching a particular user defined function to cust button Ajay Excel Discussion (Misc queries) 3 February 23rd 05 08:29 AM
User defined charts- font size too small Bill B Charts and Charting in Excel 1 December 30th 04 06:23 PM
how to move user defined function Grant Excel Worksheet Functions 1 November 17th 04 06:38 PM


All times are GMT +1. The time now is 08:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"