Question

Question (excel) 1. Add a worksheet to the file and call it Output. 2. In the...

Question

(excel)

1. Add a worksheet to the file and call it Output.

2. In the Output sheet:

a. enter first name in cell A1.    

b. enter last name in cell B1.

3. Record a macro. Call your macro CIS308Exam3. Within your macro, do the following:     

a. In cell C1, use a formula to concatenate A1 and B1 with a space in between    

b. Stop recording.

4. Open your macro in Visual Basic edit mode. Copy your macro code and paste it into cell A1 of the "Macro Code" tab of this workbook.

5. Go back to the Visual Basic, and alter your macro to do the following:       

a. Make the Output sheet as the Active sheet     

b. Ask the user for their first name and supply the information to cell A1.     

c. Ask the user for their last name and supply the information to cell B1.    

d. Leave the code that concatenates A1 and B1     

e. Ask the user if they want to input another name.     

g. If the user says "Yes", it needs to add the supplied first and last name to the next A and B cells in the column, then concatenate the names in C (A2, B2 and C2, A3, B3 and C3, etc.)          

Hint: GoTo    

i. If the user says "No", then exit the macro.

6. Copy your altered macro code and paste it into cell A1 of the "Altered Macro Code" tab of this workbook.

Homework Answers

Answer #1

Macro_1

Sub CIS308Exam3()
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=RC[-2]&"" ""&RC[-1]"
End Sub

Macro_2

Sub CIS308Exam3_2()
    Dim FirstName As String
    Dim SecondName As String
    Dim counter As String
    Dim i As Integer
      
    FirstName = InputBox("Enter first name ", "Enter Value")
    SecondName = InputBox("Enter second name ", "Enter Value")
    
    Range("A1").Select
    ActiveCell.FormulaR1C1 = FirstName
    Range("B1").Select
    ActiveCell.FormulaR1C1 = SecondName
    
    Range("C1").Select
    ActiveCell.FormulaR1C1 = "=RC[-2]&"" ""&RC[-1]"
    
    counter = InputBox("Do you want to add another name", "Enter Value")
    
    i = 1
    
    Do While counter = "Yes"
    
    i = i + 1
    
    FirstName = InputBox("Enter first name ", "Enter Value")
    SecondName = InputBox("Enter second name ", "Enter Value")
      
    Cells(i, 1).Value = FirstName
    Cells(i, 2).Value = SecondName
    
    Range("C1").Select
    Selection.Copy
    Cells(i, 3).Select
    ActiveSheet.Paste
    counter = InputBox("Do you want to add another name", "Enter Value")
        
    Loop

End Sub

Snapshot of the code:

Sample output

Let me know if anything is not clear.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a C++ program that converts time of day from a 24-hour notation to a 12-hour...
Write a C++ program that converts time of day from a 24-hour notation to a 12-hour notation. For example, it should convert 14:25 to 2:25 PM. (A) The user provides input as two integers separated by ‘:’. The following function prototype should capture the user inputs as described below: void input(int& hours24, int& minutes); //Precondition: input(hours, minutes) is called with //arguments capable of being assigned values. //Postcondition: // user is prompted for time in 24 hour format: // HH:MM, where...
Please answer in JAVA IDS 401 Assignment 4 Deadline In order to receive full credit, this...
Please answer in JAVA IDS 401 Assignment 4 Deadline In order to receive full credit, this assignment must be submitted by the deadline on Blackboard. Submitting your assignment early is recommended, in case problems arise with the submission process. Late submissions will be accepted (but penalized 10pts for each day late) up to one week after the submission deadline. After that, assignments will not be accepted. Assignment The object of this assignment is to construct a mini-banking system that helps...
Code Example 8-1 1. int count = 1; 2. int item_total = 0; 3. int item...
Code Example 8-1 1. int count = 1; 2. int item_total = 0; 3. int item = 0; 4. while (count < 4) { 5.      cout << "Enter item cost: "; 6.      cin >> item; 7.      item_total += item; 8.      ++count; 9. } 10. int average_cost = round(item_total / count); 11. cout << "Total cost: " << item_total << "\nAverage cost: " << average_cost; (Refer to Code Example 8-1.) If the user enters 5, 10, and 15 at the prompts, the output is: Total...
I've posted this question like 3 times now and I can't seem to find someone that...
I've posted this question like 3 times now and I can't seem to find someone that is able to answer it. Please can someone help me code this? Thank you!! Programming Project #4 – Programmer Jones and the Temple of Gloom Part 1 The stack data structure plays a pivotal role in the design of computer games. Any algorithm that requires the user to retrace their steps is a perfect candidate for using a stack. In this simple game you...
QUESTION 1 Advanced Security Inc. was hired by the Treasury Bank Inc. for securing their systems....
QUESTION 1 Advanced Security Inc. was hired by the Treasury Bank Inc. for securing their systems. The first thing they did was implement the best practice if separation of domains. As a result of this The bank had to get a new domain name. any change made in the records points to only one party who could have made that change. If you are a technical person, you must have office in a particular area of the building. accessing outside...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT