If I enter the following code into the ThisWorkbook object in a newly created Excel document:
I get the error "Object doesn't support this property or method". What do I need to do to be able to pass a WorkSheet object to the called sub?
Code:
Sub Clean (ws as WorkSheet)
MsgBox ws.Name
End Sub
Sub test()
Clean (WorkSheets("Sheet2"))
End Sub
I get the error "Object doesn't support this property or method". What do I need to do to be able to pass a WorkSheet object to the called sub?