sassora
07-01-2012, 03:37 AM
Hi
Say I have a public variable which is a worksheet. How can I set the value so that it sticks for all sub procedures in the module / project?
The following doesn't work:
Public shWorkitems As Worksheet
Sub x()
Set shWorkitems = Sheets("Job List")
End Sub
Sub y()
MsgBox shWorkitems.Name
End Sub
Say I have a public variable which is a worksheet. How can I set the value so that it sticks for all sub procedures in the module / project?
The following doesn't work:
Public shWorkitems As Worksheet
Sub x()
Set shWorkitems = Sheets("Job List")
End Sub
Sub y()
MsgBox shWorkitems.Name
End Sub