Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, but sorry to say that made it worse. It doesn't
work with either the string name or a cell reference when I use the "Evaluate" function. -----Original Message----- Use Evaluate for your sheet name parameter: Function Get_Data(rname, sname, row) Get_Data = Sheets(Evaluate(sname)).Range(rname).Cells (row) End Function Regards, Dag Johansen -----Original Message----- I created a simple function to retrieve data out of various one-dimensional ranges. The three arguments passed are the range name, the worksheet name, and the row number. When using this function in a spreadsheet I can use either "range_name" or a cell reference to a cell containing that string for the range name, and likewise can use a number or a reference to a cell containing the number for the row-number argument, but for the worksheet name argument it will let me use "worksheet_name" as a string, but won't let me use a cell-reference to a cell containing that string. Have tried several different times thinking maybe it's a simple syntax error on my part. Maybe it is but I cannot find it. Here is the function. Again, whenever I use a cell reference to a cell containing the worksheet name for the "sname" argument, it returns #VALUE! Help!, and of course many thanks! Function Get_Data(rname, sname, row) Get_Data = Sheets(sname).Range(rname).Cells(row) End Function This works =Get_Data($C4,"Data_Sheet",$E4) This doesn't =Get_Data($C4,$D4,$E4) . . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to? custom worksheet function using VBA | New Users to Excel | |||
Custom Worksheet Function - Absolute...? | Excel Worksheet Functions | |||
Automatic evaluation of custom worksheet function | Excel Worksheet Functions | |||
Need Function Argument | Excel Worksheet Functions | |||
using the name of the worksheet as argument | Excel Worksheet Functions |