View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Passing Worksheet tab as an argument.

Hi Kashizzz,


One way:

Function LastCell(strWSName As String) As Range
Dim ws As Worksheet
Set ws = Worksheets(strWSName)
'your code

End Function


---
Regards,
Norman



"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/