VBA Structure Day 2 Class

VBA Structure Day 2 Class - • Keep 2 blank rows •...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
VBA Structure (Day 2) MsgBox Function Shows a message box with a message that the developer specifies InputBox Function Allows the user to provide input which will be used in the macro If-Then construct You can use an If-Then construct (similar to the IF function in Excel) to execute specific code based on a condition IF [condition is true] Then [code if true] Else [code if false] End If Select Case construct When you have multiple possible values or ranges, and need to execute different code depending on which case is met, you can use the Case construct Case Select Case 1 [code] Case 2 [code] Case n [code] Case Else [code] End Select
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Insert a new employee timesheet Add a new worksheet o Name the worksheet with the employee’s name Create the following column labels: Last, First, Title, Birth Date, Hire Date o Make the font bold for these labels
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Keep 2 blank rows • Create the following column labels: Pay Period #, Hours Worked, Pay Rate, Gross Pay, Taxes, Net Pay o Make the font bold for these labels • Create the following formulas: o Gross Pay: = Hours Worked x Pay Rate o Taxes: = Gross Pay x Tax Rate o Net Pay: = Gross Pay – Taxes • Autosize the first 6 columns Use input boxes to obtain the necessary data • Have users provide data for the following fields: Last, First, Title, Pay Period, Hours Worked, Pay Rate • Update the worksheet name so that it reflects the current employee’s name • Provide the user a message that the program ran correctly Update taxes based on a condition • Use an If-Then construct to determine the appropriate tax rate • Use a Case construct to determine the appropriate tax rate...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

VBA Structure Day 2 Class - • Keep 2 blank rows •...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online