Need a VBA script for excel

Author Message
rainbal

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 11/5/2010
  • Status: offline
Need a VBA script for excel Friday, November 05, 2010 3:44 AM (permalink)
0
Hi,
 
I have 3 columns in excel
 
Order # is unique
 
Order #             Customer #                      Product#
hdf0898            1335                                 3695
ffdsf5656           1335                                 3695
 
I have 1000's of rows for different products
I would like to find whether the same customer has bought the same product more than once if there a duplicate and i want that rows to be highlighted. if you have more suggestions to find how many times, it will be more helpful.
 
Thanks in advance
 
#1
    ebgreen

    • Total Posts : 8227
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    Re:Need a VBA script for excel Friday, November 05, 2010 7:12 AM (permalink)
    0
    So here is how I would do this if it were my problem to solve:
     
    Make a dictionary where the key is the customer id and the value is another dictionary. The second dictionary would have the key be a product ID and the value would be the number of times the customer had ordered that product. Here are some search terms to get you started:
     
    WScript.Dictionary
    Excel.Application
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      nov0798

      • Total Posts : 2
      • Scores: 0
      • Reward points : 0
      • Joined: 11/19/2010
      • Status: offline
      Re:Need a VBA script for excel Friday, November 19, 2010 4:31 PM (permalink)
       
      #3
        hsreeves

        • Total Posts : 2
        • Scores: 0
        • Reward points : 0
        • Joined: 4/14/2011
        • Status: offline
        Re:Need a VBA script for excel Thursday, November 17, 2011 4:00 AM (permalink)
        0
        My suggestion doesn't use VB or VBA, but rather a built in Excel capability...
         
        I would simply establish a filter on the header row and then filter on the customer ID, sorting by Product number.
        The built-in Total, Average and other functions still work in this mode as do the charting functions.
         
        <message edited by hsreeves on Thursday, November 17, 2011 4:02 AM>
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9