View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] witek84@gmail.com is offline
external usenet poster
 
Posts: 7
Default take sheet to procedure

I want to take sheet to procedure and i don't know how write it
I thought I must do this like that:

sub procedure1(sheet1 as worksheet)
....
end sub

sub main()

Dim file As Workbook
Dim sheet2 As Worksheet

Set file = Workbooks("file to use.xls")
Set sheet2= file.Sheets("somekindsheet")

procedure1 sheet2 ''I tried too procedure1(sheet2) and didn't work

end sub

and I don't know what I'm doing wrong. When I create procedure for value
everything is ok and working but for worksheet...