Question

Problem: 1. There are two lists of customers: those who bought products in 2016 and those who bought products in 2017. Each o

А 1 Customers By Year Customer Report Create Customer Report Customers 2016 Only Customers 2017 Only Customers 2016 and 2017

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Assign the below code to a button 'CreateCustomerReport' to get the desired list. It is Raanged for the visible part of the number of rows in the uploaded image i.e from 4 to 23; You can tweak the code as per your requirements.


Sub CreateCustomerReport()
    Dim rngCell As Range
    For Each rngCell In Range("A4:A23")
        If WorksheetFunction.CountIf(Range("B4:B23"), rngCell) = 0 Then
            Range("D" & Rows.Count).End(xlUp).Offset(3) = rngCell
        End If
    Next
    For Each rngCell In Range("B4:B23")
        If WorksheetFunction.CountIf(Range("A4:A23"), rngCell) = 0 Then
            Range("E" & Rows.Count).End(xlUp).Offset(3) = rngCell
        End If
    Next
    For Each rngCell In Range("B4:B23") 
         If WorksheetFunction.CountIf(Range("A4:A23"), rngCell) = 1 Then   
            Range("F" & Rows.Count).End(xlUp).Offset(3) = rngCell 
       End If
    Next
End Sub
Add a comment
Know the answer?
Add Answer to:
Problem: 1. There are two lists of customers: those who bought products in 2016 and those...
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
  • What happened on United flight 3411?What service expectations do customers have of airlines such ...

    What happened on United flight 3411?What service expectations do customers have of airlines such as United and How did these expectations develop over time? Thank You! In early April 2017, United Airlines (United), one of the largest airlines in the world, found itself yet again in the middle of a service disaster this time for forcibly dragging a passenger off an overbooked flight. The incident was to become a wake-up call for United, forcing it to ask itself what to...

  • I have this case study to solve. i want to ask which type of case study...

    I have this case study to solve. i want to ask which type of case study in this like problem, evaluation or decision? if its decision then what are the criterias and all? Stardust Petroleum Sendirian Berhad: how to inculcate the pro-active safety culture? Farzana Quoquab, Nomahaza Mahadi, Taram Satiraksa Wan Abdullah and Jihad Mohammad Coming together is a beginning; keeping together is progress; working together is success. - Henry Ford The beginning Stardust was established in 2013 as a...

  • CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a...

    CASE 20 Enron: Not Accounting for the Future* INTRODUCTION Once upon a time, there was a gleaming office tower in Houston, Texas. In front of that gleaming tower was a giant "E" slowly revolving, flashing in the hot Texas sun. But in 2001, the Enron Corporation, which once ranked among the top Fortune 500 companies, would collapse under a mountain of debt that had been concealed through a complex scheme of off-balance-sheet partnerships. Forced to declare bankruptcy, the energy firm...

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