Commission Workbook Showing January Worksheet (Before)Finished worksheet (After)Pseudocode for the Commission Workbook’s Open Event Procedure (10 Marks)Declare two string variables strName and strRate and one WorkSheet object variable wksJanuary.Use the Set statement to point the worksheet object variable to the January worksheet in this workbook. Use the InputBox function to prompt the user for his/her name. Store the user’s response in the string variable called strName.Use the InputBox function to prompt the user for the commission rate as a whole number. Store the user’s response in the string variable called strRate.Convert the rate stored in the strRate variable to its decimal equivalent by converting to a number using the Val function then dividing by 100. Then assign the result to the cell B1 in the January worksheet.Concatenate the string literal constant “Prepared By ” to the name stored in the strName variable and assign the result to the cell A19 in the January worksheet.
Question
Commission Workbook Showing January Worksheet (Before)Finished worksheet (After)Pseudocode for the Commission Workbook’s Open Event Procedure (10 Marks)Declare two string variables strName and strRate and one WorkSheet object variable wksJanuary.Use the Set statement to point the worksheet object variable to the January worksheet in this workbook. Use the InputBox function to prompt the user for his/her name. Store the user’s response in the string variable called strName.Use the InputBox function to prompt the user for the commission rate as a whole number. Store the user’s response in the string variable called strRate.Convert the rate stored in the strRate variable to its decimal equivalent by converting to a number using the Val function then dividing by 100. Then assign the result to the cell B1 in the January worksheet.Concatenate the string literal constant “Prepared By ” to the name stored in the strName variable and assign the result to the cell A19 in the January worksheet.
Solution
Here is the pseudocode for the Commission Workbook’s Open Event Procedure:
- Declare two string variables strName and strRate and one WorkSheet object variable wksJanuary.
Dim strName As String
Dim strRate As String
Dim wksJanuary As Worksheet
- Use the Set statement to point the worksheet object variable to the January worksheet in this workbook.
Set wksJanuary = ThisWorkbook.Sheets("January")
- Use the InputBox function to prompt the user for his/her name. Store the user’s response in the string variable called strName.
strName = InputBox("Please enter your name")
- Use the InputBox function to prompt the user for the commission rate as a whole number. Store the user’s response in the string variable called strRate.
strRate = InputBox("Please enter the commission rate as a whole number")
- Convert the rate stored in the strRate variable to its decimal equivalent by converting to a number using the Val function then dividing by 100. Then assign the result to the cell B1 in the January worksheet.
wksJanuary.Range("B1").Value = Val(strRate) / 100
- Concatenate the string literal constant “Prepared By ” to the name stored in the strName variable and assign the result to the cell A19 in the January worksheet.
wksJanuary.Range("A19").Value = "Prepared By " & strName
This pseudocode assumes that the user will enter valid inputs when prompted. In a real-world scenario, you would want to add error checking to ensure that the inputs are valid before proceeding.
Similar Questions
Use the Set statement to point the worksheet object variable to the January worksheet in this workbook. Use the InputBox function to prompt the user for his/her name. Store the user’s response in the string variable called strName.
Convert the rate stored in the strRate variable to its decimal equivalent by converting to a number using the Val function then dividing by 100. Then assign the result to the cell B1 in the January worksheet.Concatenate the string literal constant “Prepared By ” to the name stored in the strName variable and assign the result to the cell A19 in the January worksheet.
Which of the following simplifies the process of entering the months of the year in a worksheet? 1. Fill Handle tool 2. AutoSum button 3. Headings option 4. Freeze Panes option
On the Year1 sheet, in cell B8, enter a formula to display the value of cell B7 from the Salaries sheet
make it questionaries performa for themyopia progression in excel sheet
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.