Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK, I figured it out myself. A function's return value is its own name.
The following code works... Public Function FetchWages(emp_code, search_date) Workbooks("Misthoi.xls").Activate Worksheets("Data").Activate evaluate_string = "MATCH(1,(R_CODES=" & emp_code & ")*(R_FROM<=" & search_date & ")*(R_TO =" & search_date & "),0)" table_row = Evaluate(evaluate_string) If IsNumeric(table_row) Then FetchWages = Application.Index(Range("D_WAGES"), table_row, 7) Else FetchWages = 0 End If End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to reference a worksheet with a variable vs a name | Excel Programming | |||
How to use variable in reference | Excel Worksheet Functions | |||
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable | Excel Worksheet Functions | |||
Variable reference | Excel Programming | |||
Using a variable as a row reference? | Excel Programming |