vba use function in sub code example
Example: prive sub enter clicked vb
Private Sub Form_PreviewKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles Form.PreviewKeyDown
If e.KeyCode = Keys.Enter Then
'code here
End If
End Sub