Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

[10 marks] Question 1 You will create a VBA procedure that counts the number of

ID: 643312 • Letter: #

Question

[10 marks] Question 1 You will create a VBA procedure that counts the number of times the digits 0-9 occurs in an integer provided by the user. The VBA procedure must ask the user to enter the integer through an in put box: The procedure must output the total number of times each digit 0.9 occurs to the active work sheet starting at Cell Al. Column A contains digits 0.9. Column B contains the number of times each digit occurs in the user-supplied integer. The result for the above example would be You must do the following: Create a workbook called question 1.xlsm Create a sub procedure in a module. Give the sub procedure a meaningful name in relation to what it does You must use an input box to get the number from the user. The syntax for an input box is = InputBox() You must use an array to keep track of the number of times a digit occurs in the user-supplied integer. Test your procedure for several integers. Save it as questionl.xlsm and submit the workbook.

Explanation / Answer

Sub Box()

       Dim Result As String

       Result=InputBox(prompt:="Enter an integer","DataEntry")

       if Result=Empty Then Exit Sub 'Terminates here if empty

       ActiveCell.Value=Result

End Sub

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote