mercredi 1 avril 2015

Excel VBA programming range selection questions [on hold]

NEED HELP DOING THIS PLEASE:



  1. Opens an Input box and prompts the user to choose a worksheet number from 1 to

  2. Stores the value the user entered in a variable of type integer named Index. You may assume the user will always enter a valid input (i.e. 1, 2 or 3). The program will give run time error if the user enters text for example- but you do not need to write code to handle this case.

  3. Uses the index number entered by the user and the Worksheets( ) collection object to activate the selected worksheet.

  4. Find the number of items in the list in column A (starting in cell A1) and store it in a variable named L1; find the number of items in the list in column B (starting in cell B1) and store it in a variable named L2.

  5. Use an If statement to determine what string to store in a variable named Answer: “ List 1 is longer” if the number of items in column A is larger. "List 2 is longer" if the number of items in column B is larger, and "Same length" otherwise.

  6. Open a message box showing Answer.


Aucun commentaire:

Enregistrer un commentaire