Question
The last time I submitted this it was wrong! The file High Spenders.xlsx contains a list of customers and the amounts they spent during the
The last time I submitted this it was wrong! The file High Spenders.xlsx contains a list of customers and the amounts they spent during the past month. Write a sub that captures the existing lists in two arrays and then creates two new arrays of customer names and amounts spent for customers who spent at least $500. After these new arrays have been filled, write their contents to columns D and E of the worksheet.
Here is what I have so far, if I could use somewhat of this code that would be great, if it needs to be changed around thats fine: Sub HiSpender() Dim customer1 () As String amtSpent1() As Integer Dim customer2 () As String amtSpent2() As Integer Dim sizeData As Integer size of data Dim count As Integer counter variable in for loop stmt With wsData.Range(A3) SizeData = Range(.Offset(1,0), .Offset(0, 0). End(xlDown).Rows.count ReDim customer1 (1 To sizeData) ReDim atmSpent1 ( 1 To sizeData) For count = 1 To sizeData Customer1(count) = .Offset(count, 0).Value amtSpent1(count) = .Offset(count, 1).Value Next End With MsgBox sizeData End Sub
Existing list | New list (spent over $500) | |||
Customer | AmtSpent | Customer | AmtSpent | |
Barlog | $520 | |||
Barnett | $610 | |||
Bedrick | $540 | |||
Brulez | $460 | |||
Cadigan | $380 | |||
Castleman | $580 | |||
Chandler | $610 | |||
Chen | $560 | |||
Cheung | $540 | |||
Chong | $610 | |||
Chou | $450 | |||
Darbro | $510 | |||
Dewi | $410 | |||
Dove | $530 | |||
Dudley | $470 | |||
Eastman | $590 | |||
Eberhart | $490 | |||
Ebina | $490 | |||
Fant | $640 | |||
Flotken | $590 | |||
Flynn | $390 | |||
Folloder | $500 | |||
Funk | $460 | |||
Gehring | $460 | |||
Gerde | $600 | |||
Ginter | $300 | |||
Gould | $540 | |||
Graves | $550 | |||
Hall | $490 | |||
Hanley | $500 | |||
Hayashiguchi | $330 | |||
Hayes | $460 | |||
Heintz | $390 | |||
Henderson | $540 | |||
Holder | $550 | |||
Hsu | $470 | |||
Johnson | $490 | |||
Jones | $680 | |||
Joy | $590 | |||
Kartikahadi | $420 | |||
Kelker | $380 | |||
Kline | $410 | |||
Kumar | $590 | |||
Lane | $600 | |||
Le | $530 | |||
Lehmann | $550 | |||
Levitt | $500 | |||
Lewis | $570 | |||
Lu | $360 | |||
Lunsford | $440 | |||
Macey | $550 | |||
Majcher | $490 | |||
Maloney | $530 | |||
Mehay | $600 | |||
Miller | $370 | |||
Mistry | $410 | |||
Mushlin | $470 | |||
Myers | $410 | |||
Nathan | $520 | |||
Neville | $380 | |||
Okrzesik | $550 | |||
Papp | $540 | |||
Parakh | $450 | |||
Prigozen | $510 | |||
Pruden | $380 | |||
Rheem | $540 | |||
Richardson | $680 | |||
Ripperger | $420 | |||
Rodibaugh | $460 | |||
Samboen | $570 | |||
Sandberg | $580 | |||
Sears | $340 | |||
Souers | $590 | |||
Staadeker | $370 | |||
Steffen | $420 | |||
Suriany | $300 | |||
Swanson | $470 | |||
Tan | $640 | |||
Tebawi | $450 | |||
Tracy | $390 | |||
Treadway | $500 | |||
Tuesley | $520 | |||
Ubelhor | $550 | |||
Vicars | $570 | |||
Villard | $400 | |||
Wendel | $400 | |||
Wier | $430 | |||
Wise | $640 | |||
Wood | $460 | |||
Wyatt | $520 | |||
Yablonka | $470 | |||
Zick | $460 | |||
Ziegler | $490 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started