Question
write the code for a). to e) using VBA in excel
: . a) Find the fifth customer whose first name starts vith ·K, and show his/her customer ID (using Do while ǐoop) b) Redo
Formulas File Home Insert Draw Page Layout xr Adam First name Customer ID arron 14 Kudelich Catherine 24 Banerjee Therese Nic
I insert Draw Page Layout Formulas Dota Review View Help File Home Adam Anna 1 Lee Johnathar Heejin Customers O Type here to
Home File Home Insert Draw Page Layout Formulas Data Review ViewHelp Adam Rupani ng 101 Stumbaugh Customers 0 Type here to se
e fifth customer whose first name starts with K, and show his/her customer ID (using Do While loop) b) Redo the above exe
: . a) Find the fifth customer whose first name starts vith ·K", and show his/her customer ID (using Do while ǐoop) ' b) Redo the above exercise with (Do Loop Until) c) Find how many Matthew are in the 1ist (using any loop you 1ike) and the same time find how many custoners are in the list ' Take care of your stop condition customerCounter - matthewCounter MsgBox "We have " ‘ matthewCounter ‘ " Matthew in the į įst of ” & eustome rCounter " -custone rs,- d) Create an arra Put the nanes of "BiL"Bob", Tom, "Mike, "Jim" in the array Add a new employee "Hary" in the array above using the End Sub
Formulas File Home Insert Draw Page Layout xr Adam First name Customer ID arron 14 Kudelich Catherine 24 Banerjee Therese Nicholas Anushka Customers Ready O Type here to search
I insert Draw Page Layout Formulas Dota Review View Help File Home Adam Anna 1 Lee Johnathar Heejin Customers O Type here to search
Home File Home Insert Draw Page Layout Formulas Data Review ViewHelp Adam Rupani ng 101 Stumbaugh Customers 0 Type here to search
' e fifth customer whose first name starts with 'K', and show his/her customer ID (using Do While loop) b) Redo the above exercise with (Do Loop Unti1) c) Find how many Matthew are in the list (using any loop you like and the same time find how many customers are in the list ' Take care of your stop condition customerCounter0 matthewCounter0 MsgBox "We have matthewCounter &Matthew in the list of "&customerCounter&"customers." ' d) Create an array of 5 employees with the dynamic indexing method Put the names of "Bi11", "Bob", "Tom", "Mike", Jim in the array ' e) Add a new employee "Mary" in the array above using the preserve met End Sub
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Book1 Microsoft Excel HomeInsertPage LayoutFormulas Data Review View Developer r Properties ヤView Code ModeRun Dialog Map Pro'a.
Sub MAC1()
Dim i As Integer
Dim c As Integer
c = 0
i = 1


While i <= 24
s = Cells(i, 2)
s1 = Left(s, 1)
If s1 = "K" Then
c = c + 1
If c = 5 Then


MsgBox (s)
MsgBox (Cells(i, 3))
End If
End If

i = i + 1


Wend


End Sub
'b.


Sub MAC1()
Dim i As Integer
Dim c As Integer
c = 0
i = 1


Do
s = Cells(i, 2)
s1 = Left(s, 1)
If s1 = "K" Then
c = c + 1
If c = 5 Then


MsgBox (s)
MsgBox (Cells(i, 3))
End If
End If

i = i + 1


Loop Until i >= 24

End Sub
'c.

Sub MAC1()
Dim customercounter As Integer
Dim matthewcounter As Integer
Dim i As Integer

customercounter = 0
matthewcounter = 0
i = 1
While i <= 24
s = Cells(i, 2)
customercounter = customercounter + 1
If s = "Matthew" Then
matthewcounter = matthewcounter + 1


End If

i = i + 1

Wend

MsgBox ("we have " & matthewcounter & " Matthews in the list of " & customercounter & " customer")


End Sub
'd.
Sub mac2()
Dim myArray() As String
ReDim myArray(4)
myArray(0) = "bill"
myArray(1) = "bob"
myArray(2) = "tom"
myArray(3) = "mike"
myArray(4) = "Jim"
ReDim Preserve myArray(5)
myArray(5) = "Marry"
For i = 0 To 5
MsgBox (myArray(i))
Next


End Sub

Add a comment
Know the answer?
Add Answer to:
Write the code for a). to e) using VBA in excel
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 6 (1 point) Questions 6-10 is one hypothesis testing problem using an Excel data called...

    Question 6 (1 point) Questions 6-10 is one hypothesis testing problem using an Excel data called vacation. Click the file name to download the Excel data file. We want to know if there is a difference between the average individual vacation budget of this year and that of last year. We collected two independent samples of 15 individuals' vacation from each year. We assume population variance are not equal. What is the null hypothesis? O a) H1-H2 = 0 Ob)...

  • Write in java language ================== Office Supplies Inc., an office supply store, services many customers. As...

    Write in java language ================== Office Supplies Inc., an office supply store, services many customers. As customers’ orders for office supplies are shipped, information is entered into a file. Office Supplies bills their customers once each month. At the end of each month, the Chief Executive Officer requests a report of all customers sorted by their customer id (from lowest to highest). The report includes their bill balance and tax liability. Write a program to produce the outstanding balance report...

  • write a code on .C file Problem Write a C program to implement a banking application...

    write a code on .C file Problem Write a C program to implement a banking application system. The program design must use a main and the below functions only. The program should use the below three text files that contain a set of lines. Sample data of these files are provided with the assessment. Note that you cannot use the library string.h to manipulate string variables. For the file operations and manipulations, you can use only the following functions: fopen(),...

  • Using the Excel file Forecasting Sales Using Ad Dollars Data use Excel to create a forecast...

    Using the Excel file Forecasting Sales Using Ad Dollars Data use Excel to create a forecast of Sales $ using Ad $. Analyze the data using simple linear regression in Excel to answer the following questions. Does more ad spending increase, decrease, or have no effect on sales $? What is the regression equation? Write it and its numerical values. Using the regression equation calculate predicted sales and error values and enter them into the Excel spreadsheet in the appropriate...

  • Using the DuPont identity- Excel FILE HOME INSERT PAGE LAYOUT FORMULAS DATA REVIEW VIEW Sign In...

    Using the DuPont identity- Excel FILE HOME INSERT PAGE LAYOUT FORMULAS DATA REVIEW VIEW Sign In Arial 12A A Paste - A Alignment Number Conditional Format as Cell Cells Formatting TableStyles- Clipboard Font Styles D13 Zombie Corp. has a profit margin of 5.1 percent, total asset turnover of 1.95, and ROE of 16.15 percent. What is this firm's debt-equity ratio? Profit margin Total asset turnover Return on equity 5.10% 1.95 16.15% 10 Complete the following analysis. Do not hard code...

  • so i did the general ledgers but the first picture is te instructions, second picture is...

    so i did the general ledgers but the first picture is te instructions, second picture is the data , the rest are diffent sheets i have to fill out PUUCIU Font Alignment B21 Number ACC 101 Comprehensive Problem Seaside Cleaning Service REQUIRED Step 1 Step 2 Step 3 Step 4 Step 5 0 Step 6 1 Journalize the July transactions. Use journal page 1. Post the July transactions from page J1 to the general ledger. Prepare a trial balance at...

  • FIN 313 Marginal Tax Example - Excel PEDAS - 0 x File Page Layout Formulas Data...

    FIN 313 Marginal Tax Example - Excel PEDAS - 0 x File Page Layout Formulas Data Review View Help ACROBAT Tell me what you want to do 2 Share suas Home Insert * Calibri B IU -11 A A === » ab Wrap Text General 1 X 0 AutoSum 47 0 Paste - A E S E E Merge & Center - $ % , e Insert Delete Format Conditional Format as Cell Formatting* Table Styles Styles Clear Sort &...

  • Tools Data Window 100% 22 A Sun Jan 19 22 45 06 Q E Excel File...

    Tools Data Window 100% 22 A Sun Jan 19 22 45 06 Q E Excel File Edit ... AutoSave Home Insert Draw X Arial Pato BI 651 xv fx View Insert Format ABES Page Layout Formulas 10 A A O A Comments Data Review = = = Help ® 6.29 GB X ACCT& 202 Lab 1 Student Template Winter 2020-2 Tell me what you want to do ? Wraa Text General Merge & Center Merge & Center % : -...

  • AutoSave of Exam3 PartB_SP20_Due_04_24 - Excel File Home insert Draw Page Layout Formulas Data Review View...

    AutoSave of Exam3 PartB_SP20_Due_04_24 - Excel File Home insert Draw Page Layout Formulas Data Review View Help Search ΑΙ Formula Bar с 1 Week Week D E F G H I J On 3a [10 points). Data set to your left (sheet On3a) contains information on weekly sales for a local grocery store over a 12-week period. Use the data set to answer the following questions 1. Construct a time series plot. What type of pattern exists in the data?...

  • Please show using the formula in excel X Usinq the DuPont identity - Excel Sign In...

    Please show using the formula in excel X Usinq the DuPont identity - Excel Sign In DATA FILE HOME INSERT PAGE LAYOUT FORMULAS REVIEW VIEW 1 Arial 12 A A Conditional Format as Cell Paste Cells Alignment Number Editing B IU T FormattingTable Styles Clipboard Font Styles X D14 A C D Е F G K 1. 2 Y3K, Inc., has sales of $5,783, total assets of $2,604, and a debt-equity ratio of .75. If its return on equity is...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT