0% found this document useful (0 votes)
50 views9 pages

ReadyforFinal XLSM

The document describes steps to create a macro in Excel that allows a user to input multiple names. The macro will ask for a first and last name, input them into cells, concatenate the last name and first initial, and ask if the user wants to input another name. If yes, it will loop back to ask for more names until the user says no. The document also includes steps to create a dashboard with a pivot table, chart, and table with SUMIF formulas.

Uploaded by

Akademiko Helper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views9 pages

ReadyforFinal XLSM

The document describes steps to create a macro in Excel that allows a user to input multiple names. The macro will ask for a first and last name, input them into cells, concatenate the last name and first initial, and ask if the user wants to input another name. If yes, it will loop back to ask for more names until the user says no. The document also includes steps to create a dashboard with a pivot table, chart, and table with SUMIF formulas.

Uploaded by

Akademiko Helper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

,

1. Record a macro. Call your macro CIS308Exam3. Within your macro, do the following:
a. Add a worksheet to the file and call it Output.
b. Type your instructor's first name in cell A1.
c. Type your instructor's last name in cell B1.
d. In cell C1, use a formula to find If values exist in column A and B of the row, then concatenate the last name first, a comm
e. Stop recording.
2. Open your macro in Visual Basic edit mode - your main code area should be no more than 12 lines at this point.
3. Copy your macro code and paste it into cell A1 of the "Macro Code" tab of this workbook.
4. Go back to the Visual Basic, and alter your macro using no more than 25 lines in your main code:
a. Remove the code to add a sheet, and instead select the Output sheet.
b. Change the code that has your instructor's first name to ask the user for their first name and supply the information to ce
c. Change the code that has your instructor's last name to ask the user for their last name and supply the information to cel
d. Leave the code that concatenates the name and first initial.
e. Add code called 'addname' to ask the user if they want to input another name.
f. Declare an integer variable "k" and set it equal to 1.
g. Write a loop using Wend and While to do the following:
As long as the user says "yes" it will add the supplied first and last name to the next A and B cells in the column, the
h. Have this repeat (A2, B2 and C2, A3, B3 and C3, etc.) until the user says “no” they do not want to input another name.
i. If the user says no, then say "Thanks for playing!" and exit the macro.
5. Copy your altered macro code and paste it into cell A1 of the "Altered Macro Code" tab of this workbook.
6. Using the Dashboard Data, create a Dashboard of the following three separate elements on the Dashboard tab.
- a pivot table, showing the revenue and quantities of each product type by product lines.
Paste your pivot table in cell B2 of the Dashboard. Resize the columns so all data fits.
Put a Header above in row A that says Revenue and Quantity of Products. Merge and Center cells A1-C1 so the head
Change the pivot table headers to Revenue and Quantity, formatting the revenue as accounting.
- a 2D pie chart based on the total quantity of each order method type. (Hint: create a pivot table first)
Add data labels, and make the chart title Order Quantity Totals.
Copy your chart and paste it in cell E2 of the Dashboard tab.
Resize the chart to fit in cells E2-K19 on the Dashboard.
- On the Dashboard Data Worksheet tab, make a table: four columns by 3 rows. Label the columns Q1-Q4 and the rows 201
Use SUMIF to get the total quantity for each intersection of the table (i.e. Q1 2012, etc).
Add the bright yellow color surrounding the table and filling the headers - but leave the data area white.
Take a picture using the Camera and add it to the Dashboard tab in cell E21.
Resize the picture to fit in cells E21-K29 on the Dashboard.
7. Save your exam - make sure it is a macro-enabled format so that your macros can be tested during grading.
8. Close your exam, upload it to exam 3 question 1, then reopen your file and use it to answer the remaining exam questions.

This study source was downloaded by 100000856561609 from CourseHero.com on 11-07-2022 02:52:47 GMT -06:00

https://www.coursehero.com/file/95205315/ReadyforFinalxlsm/
te the last name first, a comma, a space, and the first initial of the first name into column C of the corresponding row

lines at this point.

d supply the information to cell A1.


supply the information to cell B1.

and B cells in the column, then concatenate the last name and initial iin C.
ant to input another name.

workbook.
e Dashboard tab.

Center cells A1-C1 so the header fits in the middle.

mns Q1-Q4 and the rows 2012-2014.

he data area white.

uring grading.
e remaining exam questions.

This study source was downloaded by 100000856561609 from CourseHero.com on 11-07-2022 02:52:47 GMT -06:00

https://www.coursehero.com/file/95205315/ReadyforFinalxlsm/
" Selection.FormulaR1C1 = "=CONCATENATE(RC[-1],"", "",(LEFT(RC[-2],1)))"

This study source was downloaded by 100000856561609 from CourseHero.com on 11-07-2022 02:52:47 GMT -06:00

https://www.coursehero.com/file/95205315/ReadyforFinalxlsm/
Sub Concatenate()
'
' CIS308Exam3 Macro
'

'
Selection.FormulaR1C1 = "=CONCATENATE(RC[-1],"", "",(LEFT(RC[-2],1)))"

End Sub

This study source was downloaded by 100000856561609 from CourseHero.com on 11-07-2022 02:52:47 GMT -06:00

https://www.coursehero.com/file/95205315/ReadyforFinalxlsm/
Sub Cis3088Exam3()
'
' Cis3088Exam3 Macro
'
Sheets("Output").Select
Dim x, y As String
Dim k As Integer
k=0

Repeat:

k=k+1
x = InputBox("Enter first name:")
y = InputBox("Enter last name:")

Range("A" & CStr(k)) = x


Range("B" & CStr(k)) = y
Range("C" & CStr(k)).Select

Selection.FormulaR1C1 = "=CONCATENATE(RC[-1],"" ,"",(LEFT(RC[-2],1)))"


Range("A2").Select

'addname
If MsgBox("Do you want to add another name?", 4) = vbYes Then GoTo Repeat

While vbQuestion = vbYesNo + MsgBox("Thanks for playing")


Selection.FormulaR1C1 = "=Concatenate(RC[-1],"","",Left(RC[-2],1)))"

Range("A2").Select

Wend

End

End Sub

This study source was downloaded by 100000856561609 from CourseHero.com on 11-07-2022 02:52:47 GMT -06:00

https://www.coursehero.com/file/95205315/ReadyforFinalxlsm/
Sub Cis3088Exam3()
'
' Cis3088Exam3 Macro
'
Sheets("Output").Select
Dim x, y As String
Dim k As Integer
k=0
Repeat:
k=k+1
x = InputBox("Enter first name:")
y = InputBox("Enter last name:")

Range("A" & CStr(k)) = x


Range("B" & CStr(k)) = y
Range("C" & CStr(k)).Select

Selection.FormulaR1C1 = "=CONCATENATE(RC[-2],"" "",RC[-1])"


Range("A2").Select
'addname

MsgBox ("Do you want to add another name?"), vbQuestion + vbYesNo + vbDefaultButton2 = vbNo

While vbQuestion = vbYesNo + MsgBox("Thanks for playing") = vbNo

Wend

End

End Sub

Sub Cis3088Exam3()
'
' Cis3088Exam3 Macro
'
Sheets("Output").Select
Dim x, y As String
Dim k As Integer
k=0
Repeat:
k=k+1
x = InputBox("Enter first name:")

This study source was downloaded by 100000856561609 from CourseHero.com on 11-07-2022 02:52:47 GMT -06:00

https://www.coursehero.com/file/95205315/ReadyforFinalxlsm/
y = InputBox("Enter last name:")

Range("A" & CStr(k)) = x


Range("B" & CStr(k)) = y
Range("C" & CStr(k)).Select

Selection.FormulaR1C1 = "=CONCATENATE(RC[-2],"" "",RC[-1])"


Range("A2").Select
'addname

MsgBox ("Do you want to add another name?"), vbQuestion + vbYesNo + vbDefaultButton2 = vbNo

While vbQuestion = vbYesNo + MsgBox("Thanks for playing") = vbNo

Wend

End

End Sub

This is IT
Sub Cis3088Exam3()
'
' Cis3088Exam3 Macro
'
Sheets("Output").Select
Dim x, y As String
Dim k As Integer
k=0
Repeat:
k=k+1
x = InputBox("Enter first name:")
y = InputBox("Enter last name:")

Range("A" & CStr(k)) = x


Range("B" & CStr(k)) = y
Range("C" & CStr(k)).Select

Selection.FormulaR1C1 = "=CONCATENATE(RC[-1],"" ,"",(LEFT(RC[-2],1)))"


Range("A2").Select

This study source was downloaded by 100000856561609 from CourseHero.com on 11-07-2022 02:52:47 GMT -06:00

https://www.coursehero.com/file/95205315/ReadyforFinalxlsm/
'addname

If MsgBox("Do you want to add another name?", 4) = vbYes Then GoTo Repeat

Selection.FormulaR1C1 = "=CONCATENATE(RC[-1],"" ,"",(LEFT(RC[-2],1)))"


Range("A2").Select

While vbQuestion = vbYesNo + MsgBox("Thanks for playing", 4) = vbNo

Wend

End

End Sub

This study source was downloaded by 100000856561609 from CourseHero.com on 11-07-2022 02:52:47 GMT -06:00

https://www.coursehero.com/file/95205315/ReadyforFinalxlsm/
Sub Cis3088Exam3()
'
' Cis3088Exam3 Macro
'
Sheets("Output").Select
Dim x, y As String
Dim k As Integer
k=0

Repeat:

k=k+1
x = InputBox("Enter first name:")
y = InputBox("Enter last name:")

Range("A" & CStr(k)) = x


Range("B" & CStr(k)) = y
Range("C" & CStr(k)).Select

Selection.FormulaR1C1 = "=CONCATENATE(RC[-1],"" ,"",(LEFT(RC[-2],1)))"


Range("A2").Select

'addname
If MsgBox("Do you want to add another name?", 4) = vbYes Then GoTo Repeat

While vbQuestion = vbYesNo + MsgBox("Thanks for playing")


Selection.FormulaR1C1 = "=Concatenate(RC[-1],"","",Left(RC[-2],1)))"

Range("A2").Select

Wend

End

End Sub

This study source was downloaded by 100000856561609 from CourseHero.com on 11-07-2022 02:52:47 GMT -06:00

https://www.coursehero.com/file/95205315/ReadyforFinalxlsm/
Powered by TCPDF (www.tcpdf.org)

You might also like