Answers for "excel vba call other sub"

VBA
1

execute sub from another sub vba

Sub Main() 
 HouseCalc 99800, 43100 
 Call HouseCalc(380950, 49500) 
End Sub 
 
Sub HouseCalc(price As Single, wage As Single) 
 If 2.5 * wage <= 0.8 * price Then 
 MsgBox "You cannot afford this house." 
 Else 
 MsgBox "This house is affordable." 
 End If 
End Sub
Posted by: Guest on August-27-2020
0

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
Posted by: Guest on July-29-2020

Code answers related to "VBA"

Browse Popular Code Answers by Language