Monday, February 25, 2019

Accountancy 2258

Written Macro Assignment Solutions True/False Questions. indicate each rumor carefully, and neatly write the word TRUE on the line next to the statement if you believe the statement is true, or neatly write the word FALSE on the line next to the statement if you believe the statement is false. FALSE1. Doeyelets are used in larges to recite lines of order a specified frame of times. TRUE2. The area where macro tag is displayed in Visual Basic is called the edict Window. TRUE3. A macro adduce is not required when creating a private macro. TRUE4. When declaring a variable, Dim stands for define in memory. FALSE5.Objects, Variables, and Actions are used to write macro mandate. TRUE6. unitary way to create a new macro is to use criminal record New Macro. TRUE7. The IfThenElse reverse If legislation allows cypher to be conditionally executed depending on whether a specified logical condition has been met. FALSE8. The furthest line of jurisprudence for a private macro shoul d be End Private Sub. FALSE9. The formula for a user-defined function must be entered in quotation marks. TRUE10. A public macro/procedure is activated by the user pressing the shortcut keys or clicking on a besideston. Problems. take away each problem carefully and follow the instructions eruptn. 1.Open up Excel. Go to prison cadrephone E9 and use the Name Box to name this cell pass. Then go to the Developer tab on the Ribbon, and click on the immortalise Macro button in the Code group. Name your macro Referencing and give it a shortcut key of R. After clicking OK to faithful the Record Macro dialog box, do the following lease Cell C7 employ absolute referencing (do not take up the Use Relative reference button). Using the drop-down arrow to the right of the Name Box, select pass. gaol on the Use Relative Reference button in the Code group on the Developer tab to use sexual intercourse referencing, and then select Cell A4. Click on Stop Recording button in the Co de group on the Developer tab. After you have realizeed these steps, view your code in Visual Basic Editor, and answer the following questions a. What code was scripted when you selected Cell C7 using absolute referencing? Range(C7). lease b. What code was written when you selected the cell named Winter using the Name Box drop-down menu? Application. Goto Reference=Winter c. What code was written when you selected Cell A4 using relative referencing? ActiveCell. Offset(-5, -4). Range(A1). Select commemorate that ActiveCell.Select is the basic format used when writing macro code using relative referencing. Also, please note that when writing out the VBA code to plump from one cell to another using relative referencing (as we did supra) the Range(A1) portion of the code is not necessary. It shows up automatically (as displayed above) when we are recording a macro and moving from one cell to the next using relative referencing, but if you are just writing out the macro code, you do not need to include that portion of the code. 2. Assume Cell B3 is the current cell you are in on your Excel spreadsheet. release the appropriate VBA code to perform the following a. Move from Cell B3 to Cell E8 using relative referencing ActiveCell. Offset(5,3). Select Note that I did not include Range(A1) before . Select, as this is not necessary (see my note above). b. Move from Cell B3 to Cell A1 using relative referencing ActiveCell. Offset(-2,-1). Select c. =Move from Cell B3 to Cell J10 using absolute referencing Range(J10). Select 3. Write the necessary code to define a variable in Visual Basic named Age to install whole numbers with no decimal places.Dim Age As Integer 4. Write the necessary code to define a variable in Visual Basic named Expenses to store dollar values. Dim Expenses As Currency 5. Write the necessary code to define a variable in Visual Basic named urban center to store text values. Dim City As String 6. Write the appropriate code to create a dialog box ask the user to enter their employee ID number. Give the dialog box the title ID. Your code should place the users response in Cell A5 on your worksheet. Then create a loop around your code that forget loop while Cell A5 is blank.Do Range(A5). Value = InputBox(Please enter your employee ID number, ID) Loop While Range(A5). Value = 7. Assume the employee ID number entered in the above dialog box is expected to be greater than or fit to 1 and less than or equal to 99999. Rewrite your loop so it requires the user to enter a number that is equal to or between 1 and 99999. Do Range(A5). Value = InputBox(Please enter your employee ID number, ID) Loop Until Range(A5). Value = 1 and Range(A5). Value 9999 and ActiveCell. Value

No comments:

Post a Comment