Write a single sub procedure named picnic

Assignment Help Other Engineering
Reference no: EM131844667

Homework: Writing sub procedures

PROBLEMS - Open a blank Excel workbook and save it as a MACRO-ENABLED file. Your workbook must contain only two worksheets named "Prob1" and "Prob2", respectively. Open the Visual Basic Editor (VBE) and insert a new module into the Project Explorer. You must write (NOT record) all your sub procedures inside this module.

Problem 1 -

Table 1 shows the names of guests invited to a company's picnic at an amusement park. Table 1 also shows the department each guest belongs to and how many people are coming with them (broken down by adults and children). The cost of each ride is $4 per adult and $2 per child. There are 9 rides for adults and 7 rides for kids. Manually enter the data exactly as shown in Table 1 into worksheet "Prob1." You can format the cells manually (i.e., not via code) in Excel.

Table 1. Data for Problem 1.

No.

Guest

Department

Adults coming

Children coming

1

John Smith

IT

2

0

2

Dan Harris

Marketing

3

3

3

Jane Taylor

Design

1

2

4

Mary Davis

Finance

4

4

5

Jonathan Wilson

Logistics

2

3

Write a single sub procedure named Picnic that will format the data and calculate the values as described in Table 2.

Table 2. Data Formatting Instructions for Problem 1.

Label

Calculation

Cell Fill Color

Font Color & Type

(H2:H4)

(I2:I4)

(H2:H4)

(I2:I4)

(H2:H4)

(I2:I4)

Total Number of Guests

Total sum

None

Yellow

Black, Bold

Black, Underlined

Total Cost of Picnic

(Total sum of adults * Cost per adult * Number of rides for adults) + (Total sum of children * Cost per child * Number of rides for children)

Red

Yellow, Bold

Average Size of Party per Guest

Average

Blue

White, Italic

 

SOLUTION REQUIREMENTS:

a. The Offset property MUST be used to position all labels and calculations in their respective cells. You may use any cell in the worksheet "Prob1" as the reference cell to use the Offset property.

b. Assign the sub procedure to a shape button. The button's caption should read Calculate Statistics. The button should be visually appealing and its upper left corner should be aligned with the upper left corner of cell K2.

c. After the button is clicked, the display of the first calculation (i.e., Total Sum), its label and its corresponding cell's formats should be delayed 3 seconds. The display of every subsequent calculation (and corresponding label and formats) should then be delayed 2 seconds.

d. The text "DONE!" should be displayed in cell H7 one (1) second after the last calculation is displayed. Use capital letters and BOLD font style for this legend.

e. Range H2:I7 should be cleared automatically right after the button is pressed by your procedure every time it is run.

f. You must use the WITH construct to make your code more readable.

g. Your sub procedure should end by selecting cell A1.

Problem 2 -

Manually enter the data exactly as shown in Table 3 in columns B, C, and D, E, and F, respectively, of worksheet "Prob2." The upper left corner of Table 3 (i.e., the label "Rank") should be entered in cell B2.

Table 3. Data for Problem 2

B C D E F

Rank

Title

Lifetime Gross (USA)

Year

Studio

1

Avatar

760,507,625

2009

Fox

2

Titanic

658,672,302

1997

Paramount

3

Marvel's The Avengers

623,357,910

2012

Buena Vista

4

The Dark Knight

534,858,444

2008

Warner Bros

5

Star Wars: Episode I - The Phantom Menace

474,544,677

1999

Fox

6

Star Wars

460,998,007

1977

Fox

7

The Dark Knight Rises

448,139,099

2012

Warner Bros

8

Shrek 2

441,226,247

2004

DreamWorks SKG

9

E.T.: The Extra-Terrestrial

435,110,554

1982

Universal

10

Pirates of The Caribbean: Dead Man's Chest

423,315,812

2006

Buena Vista

SOLUTION REQUIREMENTS:

1. Write a sub procedure named Movies that will:

a. Use the Columns property of the Range object to give each column of the table its own background color. You are at liberty to pick the color for each column.

b. Copy the data in columns Title, Lifetime Gross (USA), and Year using the End property and paste it in range H2:J12.

c. Assign the sub procedure to a shape button. The button's caption should read GROSS EARNINGS BY MOVIE. The button should be visually appealing and its upper left corner should be aligned with the upper left corner of cell B15.

d. Ensure that no flashing border remains after the copy-pasting operation is complete.

e. Ensure that no flickering occurs when you run your sub procedure.

f. Your sub procedure should end by selecting cell A1.

2. Write a sub procedure named Clear_Movies that will:

a. Clear range H2:J12.

b. Assign the sub procedure to a button. The button's caption should read CLEAR. The button should be visually appealing and its upper left corner should be aligned with the upper left corner of cell E15.

Reference no: EM131844667

Questions Cloud

Explain each of the social transactions in a minimum : Explain each of the social transactions in a minimum of a paragraph and expand on other student's submissions from your prior experience if you can.
Assume the bonds are equally liquid : A triple-AAA rated corporate 10-year bond is currently paying a yield of 5.25%. Assume the bonds are equally liquid.
Define steps of change management to an HR situation : Using the company that your instructor previously approved, apply Kotter's eight (8) steps of change management to an HR situation you have selected for change.
Use cell phones at school : Essay on whether elementary and high school students should be allowed to use cell phones at school.
Write a single sub procedure named picnic : IE 212 Homework: Writing sub procedures. Write a single sub procedure named Picnic that will format the data and calculate the values as described in Table 2
The daily turnover in foreign exchange market : The daily turnover in the foreign exchange market is:
Outline on cell phones at school : Persuasive speech full sentence outline on cell phones at school. Do you think elementary and high school students should be allowed to use cell phones
What are the benefits of public radio vs commercial radio : How would America be different today if the public owned and operated radio? What are the benefits of public radio vs. commercial radio? What are the costs?
How to address an employee sexual harassment complaint : As you are reviewing the growth of your selected company, you are noticing how diversity and sexual harassment issues are impacting the overall company culture.

Reviews

len1844667

2/2/2018 1:58:49 AM

This is IE 212 Homework. This assignment need to type VBA code for excel. To obtain full credit in this homework, you must: Submit a single Excel file via Canvas. Before submitting your solution file, make sure that the sample data provided for each problem and each worksheet is in the format it was before you tested your sub procedures. Solutions for each individual problem should be prepared in separate worksheets. Make sure to follow good programming practices. In particular: Add comments to document your code, and Use indentation to make your code more readable and easier to grade. Submit all your code in a .pdf file.

len1844667

2/2/2018 1:58:43 AM

Upload your homework two homework files, the .xlsm file and the .pdf file, to Canvas before the due date specified on Canvas. Late homework will not be accepted. PROBLEMS - Open a blank Excel workbook and save it as a MACRO-ENABLED file. Your workbook must contain only two worksheets named "Prob1" and "Prob2", respectively. Open the Visual Basic Editor (VBE) and insert a new module into the Project Explorer. You must write (NOT record) all your sub procedures inside this module.

Write a Review

Other Engineering Questions & Answers

  Characterization technology for nanomaterials

Calculate the reciprocal lattice of the body-centred cubic and Show that the reciprocal of the face-centred cubic (fcc) structure is itself a bcc structure.

  Calculate the gasoline savings

How much gasoline do vehicles with the following fuel efficiencies consume in one year? Calculate the gasoline savings, in gallons per year, created by the following two options. Show all your work, and draw boxes around your answers.

  Design and modelling of adsorption chromatography

Design and modelling of adsorption chromatography based on isotherm data

  Application of mechatronics engineering

Write an essay on Application of Mechatronics Engineering

  Growth chracteristics of the organism

To examine the relationship between fermenter design and operating conditions, oxygen transfer capability and microbial growth.

  Block diagram, system performance and responses

Questions based on Block Diagram, System Performance and Responses.

  Explain the difference in a technical performance measure

good understanding of Mil-Std-499 and Mil-Std-499A

  Electrode impedances

How did this procedure affect the signal observed from the electrode and the electrode impedances?

  Write a report on environmental companies

Write a report on environmental companies

  Scanning electron microscopy

Prepare a schematic diagram below of the major parts of the SEM

  Design a pumping and piping system

creating the pumping and piping system to supply cool water to the condenser

  A repulsive potential energy should be a positive one

Using the data provided on the webvista site in the file marked vdw.txt, try to develop a mathematical equation for the vdW potential we discussed in class, U(x), that best fits the data

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd