I am creating a VBA application, and I have the following code:
Dim previousCell As range
Private Sub Worksheet_SelectionChange(ByVal target As range)
Application.EnableEvents = False
On Error GoTo ws_exit:
Set previousCell = target
getEffort (previousCell) '**Here i get object required**
ws_exit:
Application.EnableEvents = True
MsgBox Err.Description
End Sub
Private Function getEffort(ByVal cell As range)
' do soemthing
End Sub
I'm not sure why I get the error message: Object required error at getEffort(previousCell). If I pass in the Target, it works.
Thanks
Callbefore the sub name -Call getEffort(previousCell)