Prev: Unable to change "Enabled" state of an Excel 2007 ribbon galle
Next: Macro to copy a VLOOKUP formula - Data with a filter on
From: IgorM on 23 Mar 2010 04:26 Hi How to get distinct items from a recordset? Let's assume I have two columns returned from a database: countries and cities. I want to retrieve a list of unique country names. Kind regards IgorM
From: Jarek Kujawa on 23 Mar 2010 04:59 Excel 2003 Data->Filter->Advanced->select your ranges and tick "Unique records only" On 23 Mar, 09:26, "IgorM" <ig...(a)live.com> wrote: > Hi > > How to get distinct items from a recordset? Let's assume I have two columns > returned from a database: countries and cities. > I want to retrieve a list of unique country names. > > Kind regards > IgorM
From: Bob Phillips on 23 Mar 2010 05:25 Igor, Why don't you make the query return a distinct set? -- HTH Bob "IgorM" <igorm(a)live.com> wrote in message news:DC376AB8-6964-4F36-9E1B-92A97582C07E(a)microsoft.com... > Hi > > How to get distinct items from a recordset? Let's assume I have two > columns returned from a database: countries and cities. > I want to retrieve a list of unique country names. > > > Kind regards > IgorM
From: Mike H on 23 Mar 2010 05:38 Hi, List in data in columns A & B The will treat the top row as a header row. Select the list of countries and then Data|Filter|Advanced filter Select 'Copy to another location' Check 'Unique records only' Click the icon in the 'Copy to' box and select a single cell to copy to Click the icon again. OK You now have a unique list of countries. I copied mine to column M so M2 is the first country and M1 is the header. Put this in N2 and drag down as far as required. =VLOOKUP(M2,$A$2:$B$100,2,FALSE) -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "IgorM" wrote: > Hi > > How to get distinct items from a recordset? Let's assume I have two columns > returned from a database: countries and cities. > I want to retrieve a list of unique country names. > > > Kind regards > IgorM >
From: IgorM on 23 Mar 2010 06:18
Its probably me not being too specific. I don't want to query the database to restrict connections to database. I've been thinking about dumping values from a recordset to a collection and using the values as a collection key too. But is there a better way to do that - a buid-in unique filtering function. U�ytkownik "Bob Phillips" <bob.phillips(a)somewhere.com> napisa� w wiadomo�ci grup dyskusyjnych:OTgcbrmyKHA.5936(a)TK2MSFTNGP04.phx.gbl... > Igor, > > Why don't you make the query return a distinct set? > > -- > > HTH > > Bob > > "IgorM" <igorm(a)live.com> wrote in message > news:DC376AB8-6964-4F36-9E1B-92A97582C07E(a)microsoft.com... >> Hi >> >> How to get distinct items from a recordset? Let's assume I have two >> columns returned from a database: countries and cities. >> I want to retrieve a list of unique country names. >> >> >> Kind regards >> IgorM > > |