Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Unique Filter Macro not working correctly

The folloiwng macro is intended to look at a list of numbers in column "M"
and copy unique records only to column "B".
But I'm still getting duplication in column "B".

Macro:
Sub Macro1()

' copy unique Work Order numbers to columb "B"
Range("M6:M200").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"B6"), Unique:=True

End Sub

column "M"
73369
73369
73369
75817
75817

results in column "B"
73369
73369
75817

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Unique Filter Macro not working correctly

Check you data in column M, you probably have spaces at the beginning or end
of entries causing it to appear duplicated.

Use Trim to remove leading and trailing spacers

--

Regards,
Nigel




"Jay" wrote in message
...
The folloiwng macro is intended to look at a list of numbers in column "M"
and copy unique records only to column "B".
But I'm still getting duplication in column "B".

Macro:
Sub Macro1()

' copy unique Work Order numbers to columb "B"
Range("M6:M200").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"B6"), Unique:=True

End Sub

column "M"
73369
73369
73369
75817
75817

results in column "B"
73369
73369
75817


  #3   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Unique Filter Macro not working correctly

That's what i suspected at first.
But when I manually type the values in (witn no leading or trailing
spacers), I get the same results.


"Nigel" wrote:

Check you data in column M, you probably have spaces at the beginning or end
of entries causing it to appear duplicated.

Use Trim to remove leading and trailing spacers

--

Regards,
Nigel




"Jay" wrote in message
...
The folloiwng macro is intended to look at a list of numbers in column "M"
and copy unique records only to column "B".
But I'm still getting duplication in column "B".

Macro:
Sub Macro1()

' copy unique Work Order numbers to columb "B"
Range("M6:M200").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"B6"), Unique:=True

End Sub

column "M"
73369
73369
73369
75817
75817

results in column "B"
73369
73369
75817



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unique Filter Macro not working correctly

This command requires a column header. You should include the column header
for column M in the source range as well as the copy_to range.
Assuming your header for M is in M5 it will put the header in B5 followed by
the unique results under it.

Range("M5:M200").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"B5"), Unique:=True

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
Macro not working correctly Andy_N1708 via OfficeKB.com Excel Discussion (Misc queries) 3 May 27th 10 03:35 AM
Filter (blanks) with two or more unique values not working Jason Sawyer[_2_] Excel Discussion (Misc queries) 1 April 8th 10 01:22 PM
Adv Filter - Unique Items NOT working Joyce Excel Discussion (Misc queries) 3 March 12th 10 06:22 PM
Advanced Filter not working correctly in macro Tara H Excel Programming 9 January 28th 09 08:06 PM
Filter for Unique Values not working Joe M. Excel Discussion (Misc queries) 1 February 4th 08 03:11 PM


All times are GMT +1. The time now is 06:14 AM.

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"