View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Phillips Phillips is offline
external usenet poster
 
Posts: 48
Default How do I pass a worksheets name to function?

I would like to make a function that I can pass the name of a work sheet to
it, so I can use the function for many different uses.


Example:

sub test()

recct = wsreccount("sheet1")

msgbox recct



function wsreccount (wsname as workbook)

wsreccount = wsname.UsedRange.Rows.Count

end function


What would be the right way to do this? This ia a very simple example, but
gets the point across

Thanks
Phil