![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 30
|
This (and other tries at syntaxes) does not work... HELP ......
sub main() dosome("sheet1") end sub funtion dosome(sh as sheets) do something with sheet end function |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Try it
Sub main() dosome Sheets("sheet1") End Sub Function dosome(sh As Worksheet) 'do something with sheet End Function Tom |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Maybe just pass the Sheet name only ..
Code:
Sub main()
dosome ("sheet1")
End Sub
Function dosome(SheetName)
with sheets(SheetName)
'do something with sheet
end with
End Function
NOTE: Testing performed on Win2K utilizing Office 2000. Solutions may need tweaking for other versions. Adieu,Nimrod [ This Message was edited by: Nimrod on 2002-05-26 00:23 ] |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Posts: 30
|
Thanks to both TsTom and Nimrod
Although, the individual ideas didn't fully solve the problem, with your inputs and a few more tries.... It now works. FYI Sub clear() clSheet Sheets("Raw Data") End Sub Function clSheet(sh As Worksheet) ' clear contents of sheet With Sheets(sh.Name) .Range("A1:" & Chr(.UsedRange.Columns.Count + 64) & .UsedRange.Rows.Count).clear End With End Function Thanks again.... |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|