Question: 3. Complete in Excel and show your work Question 3: Public and a Private Variable Sub-Procedure - Please create two Modules and write Sub-Procedures include
3. Complete in Excel and show your work


Question 3: Public and a Private Variable Sub-Procedure - Please create two Modules and write Sub-Procedures include a Public variable and Private variables as in the Lecture 2 slide Example 3 on page 32 . - Note: Variable declaration is necessary to define a variable for a certain data type. Run the sub-procedure to make sure it works correctly. Public and Private Variable Example 3 Dim x As Integer Public p As Integer Sub sub1Example3() Dim x As Integer p=1 x=0 x=0 MsgBox ("x in sub 1= " \& x ) Sub sub3Example3 () MsgBox ("p in sub 1= " \& p) MsgBox ("x in sub 3= " \& x ) Call sub2Example3 MsgBox ("p in sub 3=" \& p) Call sub3Example3 End Sub End Sub Module 2 Sub sub2Example3 () MsgBox ("x in sub 2= " \& x ) MsgBox ("p in sub 2= " \& p) End Sub
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
