View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Raj[_2_] Raj[_2_] is offline
external usenet poster
 
Posts: 150
Default Retain rows with Max values - Delete other rows

Hi,

The following rows in a sheet contain region-wise sales of two
products:

Product Region Sales
Toyota North 50
Nissan South 42
Toyota South 30
Toyota West 60
Nissan North 32
Nissan East 35
Nissan West 25
Toyota East 37

I am looking for VBA code that will retain only the rows with the
maximum sales for a product and delete the other rows.

ie for the above input, the output should be:

Toyota West 60
Nissan South 42

Thanks in Advance for the help.
Raj