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

https://docs.google.com/spreadsheets/d/1KEn5SV3QBm6-hpZbZTtN6r0mzzqhzGfQbofPEDts

ID: 3886409 • Letter: H

Question

https://docs.google.com/spreadsheets/d/1KEn5SV3QBm6-hpZbZTtN6r0mzzqhzGfQbofPEDtscWs/edit?usp=sharing

Link to .xlxs file you should use is above and publicly accessible.

Exercise 4 (7pt). Open macro.xlsx. Create a second workbook by your own, and name it data.xlsx Activate the macro workbook. Record a macro while you do the following 1. Select Cell B2 on Sheet "discount" of the macro workbook 2. Copy the contents of this cell 3. Activate the data workbook 4. Select Cell A1 on first sheet of the data workbook 5. Use Paste Special/ Values to place the contents of the cell from the macro workbook into the newly selected cell 6. Insert a new sheet into data workbook 7. Activate the macro workbook 8. Select Cell B3 on Sheet "discount" of the macro workbook 9. Copy the contents of this cell 10. Activate the data workbook 11. Select Cell Al on the newly inserted sheet of the data workbook 12. Use Paste Special Values to place the contents of the cell from the macro workbook into the newly selected cell 13. Activate the macro workbook Stop recording. Identify all the Excel objects in your recorded Macro, for example. Workbook macro, Cell B2, etc. List them on "answer" sheet of macro workbook. Do not forget those special Excel objects Submission: Your submission file for exercise 4 should be the macro workbook with the recorded macro, and answers

Explanation / Answer

Here is the code for Recorded Macro :

Sub Macro1()
'
' Macro1 Macro
'

'
Sheets("discount").Select
Range("B2").Select
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Sheets("original").Select
Range("A1").Select
ActiveSheet.Paste
Application.WindowState = xlMinimized
Application.WindowState = xlNormal
Sheets("original").Select
Sheets.Add
Application.WindowState = xlMinimized
Application.WindowState = xlNormal
Application.WindowState = xlMinimized
Application.WindowState = xlNormal
Sheets("discount").Select
Range("B3").Select
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.WindowState = xlMinimized
Application.WindowState = xlNormal
Sheets("Sheet1").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("discount").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
ActiveSheet.Paste
Application.WindowState = xlMinimized
Application.WindowState = xlNormal
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = ""
Sheets("discount").Select
Selection.Copy
Sheets("Sheet1").Select
End Sub

Following are the Excel Objects in recorded Macro:

1.Worksheet discount

2.Worksheet Sheet1 ( New sheet)

3.Cell B3

4.Cell A1

5.Cell A2

6.Worksheet Original ( first sheet of Workbook)