Hi,
You want to pass the worksheet name as argument, so the function argument is
a string.
Function LastCell(ws As Stringt)
worksheets(ws).range( ;;;)
End Function
call the function
return = LastCell(sheet1.name)
or
return = LastCell("YOUR sheet name")
or
return = LastCell(worksheets("YOUR sheet name").name)
Regards
JY
"Kashizzz " wrote in message
...
Hi,
I have the following function requiring ws as a worksheet...
Code:
--------------------
Function LastCell(ws As Worksheet)
...
End Function
--------------------
This works fine if I call it using Sheet1, Sheet2,...
I want to pass worksheet tab names to the function. Is it possible?
Regards
---
Message posted from http://www.ExcelForum.com/