Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Filtering in VBA

I have a column of values starting in A2, Sheet 1. These values repeat and
are not unique. I want column B2 to have a single occurrence of each cell
in column A.

As an example, here's what I'm looking for:

Sheet1:
Col A Col B
============
brown brown
blue blue
black black
orange orange
black red
black
brown
blue
blue
red
blue

Thanks in advance,

Alan L. Wagoner


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Filtering in VBA

you know you can use the built in filter function in excel, and then
you wouldnt need to use vba?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Filtering in VBA

Yeah, I know, but I need to programmatically create those sheets, because I
have VBA code that will populate them. Right now, I have to manually create
them, and I'd rather have that process automated.

"Chip" wrote in message
oups.com...
you know you can use the built in filter function in excel, and then
you wouldnt need to use vba?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Filtering in VBA

Alan,

Very simple using built-in functionality

Columns("A:A").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("B1"), _
Unique:=True

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Alan L. Wagoner" wrote in message
...
I have a column of values starting in A2, Sheet 1. These values repeat

and
are not unique. I want column B2 to have a single occurrence of each cell
in column A.

As an example, here's what I'm looking for:

Sheet1:
Col A Col B
============
brown brown
blue blue
black black
orange orange
black red
black
brown
blue
blue
red
blue

Thanks in advance,

Alan L. Wagoner




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Filtering in VBA

Note that with Bob's approach it repeats the first unique entry twice.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Filtering in VBA

Not if he has headings, which he should do <g

Bob

"Chip" wrote in message
ups.com...
Note that with Bob's approach it repeats the first unique entry twice.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Filtering in VBA

Bob,

You da Man! May your weekend be filled with fun, joy, and happiness.

Cheers! I owe you a pint.

--Alan

"Bob Phillips" wrote in message
...
Alan,

Very simple using built-in functionality

Columns("A:A").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Range("B1"), _
Unique:=True

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Alan L. Wagoner" wrote in message
...
I have a column of values starting in A2, Sheet 1. These values repeat

and
are not unique. I want column B2 to have a single occurrence of each

cell
in column A.

As an example, here's what I'm looking for:

Sheet1:
Col A Col B
============
brown brown
blue blue
black black
orange orange
black red
black
brown
blue
blue
red
blue

Thanks in advance,

Alan L. Wagoner






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Filtering in VBA


"Alan L. Wagoner" wrote in message
...
Bob,

You da Man! May your weekend be filled with fun, joy, and happiness.

Cheers! I owe you a pint.


Pint of Director's please!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering without filtering [email protected] Excel Discussion (Misc queries) 3 August 27th 08 06:51 PM
need filtering help Lauri Excel Discussion (Misc queries) 1 December 11th 06 07:38 PM
filtering PBG Excel Discussion (Misc queries) 0 November 4th 05 04:47 PM
trouble filtering a list. Why isn't column filtering? Pat Excel Worksheet Functions 1 July 18th 05 03:30 PM
Filtering Dave Excel Discussion (Misc queries) 2 June 28th 05 09:43 PM


All times are GMT +1. The time now is 04:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"