Question

In: Operations Management

in VBA What is the major benefit of using Select Case over IF statements? Provide an...

in VBA

What is the major benefit of using Select Case over IF statements? Provide an example of when you would use Select Case.

Solutions

Expert Solution

ANSWER :

let's say wsal is old salary & nsal is new salary of employee

Select case wsal = nsal

Case True

MsgBox "Both Sales Are Equal.", vbInformation, "Equal"

Case False

MsgBox "Both Sales Are Not Equal.", vbExclamation, "Not Equal"

End Select


If wsal= nsal Then

MsgBox "Both Sales Are Equal.", vbInformation, "Equal"

Else

MsgBox "Both Sales Are Not Equal.", vbExclamation, "Not Equal"

End if

In the first case, select case make use of a statement in the beginning to analyse the whether the values are equal or not based on the result it moves to respective true or false case.

In the second case, if case makes use of comparison in different lines. If the value is same show equal else show unequal. Thus you have to repeatedly write the if else if & if again and again to make comparisons, thus is becomes lengthy script

Thus select case makes script compact, easy understanding, comparisons made in the beginning.


Related Solutions

What is the benefit of using “prepared statements” in the prevention of SQL injection? Select one:...
What is the benefit of using “prepared statements” in the prevention of SQL injection? Select one: a. User input is treated as secret data like passwords. b. User input is properly treated as commands, rather than as secret data like passwords c. With them it is easier to construct a SQL query d. They ensure user input is parsed as data, not (potentially) code
What is the benefit of using mean deviation over standard deviation?
What is the benefit of using mean deviation over standard deviation?
Case Study on Walmart using IT A major reason for Wal-Mart’s success over the year was...
Case Study on Walmart using IT A major reason for Wal-Mart’s success over the year was its constant emphasis on installing the most modern IT systems, which helped it achieve better economy of scale, distribution efficiency and pass on the benefits of the same to the customers. By offering low price to customers, Wal-Mart was able to generate more sales and minimize the promotional expenditure of the company. By using IT, Wal-Mart was able to establish proper communication links with...
Case Study on Walmart using IT A major reason for Wal-Mart’s success over the year was...
Case Study on Walmart using IT A major reason for Wal-Mart’s success over the year was its constant emphasis on installing the most modern IT systems, which helped it achieve better economy of scale, distribution efficiency and pass on the benefits of the same to the customers. By offering low price to customers, Wal-Mart was able to generate more sales and minimize the promotional expenditure of the company. By using IT, Wal-Mart was able to establish proper communication links with...
Which of the following statements is a possible benefit of a cleaner environment? Select the correct...
Which of the following statements is a possible benefit of a cleaner environment? Select the correct answer below: a) Property values may be higher. b) People may stay healthier and live longer. c) Industries that rely on clean air and water may benefit. d) All of the above.
Which of the following statements regarding the benefit of homeownership is incorrect? Select the most correct...
Which of the following statements regarding the benefit of homeownership is incorrect? Select the most correct answer. Select one: a. A hedge against rising rental costs. b. Certainty of substantial capital growth over time. c. Real estates are illiquid investments and the transaction costs are high. d. Capital Gains Tax main residence exemption available in Australia.
One major benefit of using the Bank Feeds feature in QuickBooks Online is that as you
One major benefit of using the Bank Feeds feature in QuickBooks Online is that as you _________________ or __________________ transactions in QuickBooks Online from the downloaded transactions from the bank, they are marked ___________________. This makes the end-of-period bank reconciliation more efficient.Fill in the missing words in this statement.record, delete, reconciledmatch, exclude, clearedmatch, add, clearedexclude, add, reconciled
Using the ABC Retailers - Internal Controls Case, provide a summary of the case and the...
Using the ABC Retailers - Internal Controls Case, provide a summary of the case and the main points of the case(5 sentences)
Select one explanation for democratization. Provide an example of a case that proves that this explanation...
Select one explanation for democratization. Provide an example of a case that proves that this explanation is either incorrect or insufficient.
Select/provide the correct term for the following statements. 5.External devices such as firewalls cannot provide access...
Select/provide the correct term for the following statements. 5.External devices such as firewalls cannot provide access control services. (True/False) 6.The ciphertext-only attack is the easiest to defend against. (True/False) 7.A brute-force approach involves trying every possible key until an intelligible translation of the ciphertext into plaintext is obtained. (True/False) 8.The Feistel structure is a particular example of the more general structure used by all symmetric block ciphers. (True/False) 9.User authentication is the basis for most types of access control and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT