Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Copy and Sort Unique Problem

I am having problems with a recorded macro:

Raw Data on Sheet 1:

C
3 424a356
4 424a356
5 424a356
6 424b650
7 424b650
8 401b000
9 401b000
10 407b000

Copy and Sorted by Unique Value on Sheet 2:

A
2 424a356
3 424a356
4 424b650
5 401b100
6 407b000

Even though I request unique values, it continues to copy the top two values
which are the same. It has something to do with a header, maybe? Is there
some code that could get me around this problem? Your help is greatly
appreciated. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Copy and Sort Unique Problem

May help to see the macro code...

"cranen" wrote:

I am having problems with a recorded macro:

Raw Data on Sheet 1:

C
3 424a356
4 424a356
5 424a356
6 424b650
7 424b650
8 401b000
9 401b000
10 407b000

Copy and Sorted by Unique Value on Sheet 2:

A
2 424a356
3 424a356
4 424b650
5 401b100
6 407b000

Even though I request unique values, it continues to copy the top two values
which are the same. It has something to do with a header, maybe? Is there
some code that could get me around this problem? Your help is greatly
appreciated. Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy and Sort Unique Problem

I bet you're using data|filter|advanced filter?

If that's true, then advanced filter has to have a header.

If you can't insert a header row (with a dummy header) in the original data, you
coul copy the column, paste to a new sheet, insert the header, do the advanced
filter, move the data to its final home.





cranen wrote:

I am having problems with a recorded macro:

Raw Data on Sheet 1:

C
3 424a356
4 424a356
5 424a356
6 424b650
7 424b650
8 401b000
9 401b000
10 407b000

Copy and Sorted by Unique Value on Sheet 2:

A
2 424a356
3 424a356
4 424b650
5 401b100
6 407b000

Even though I request unique values, it continues to copy the top two values
which are the same. It has something to do with a header, maybe? Is there
some code that could get me around this problem? Your help is greatly
appreciated. Thanks.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Copy and Sort Unique Problem

I apologize. It will only let me copy to the active sheet. I really would
like to copy it to another sheet. Anyways, here is the code:

Sub Copy_Sort_Unique()
'
' Copy_Sort_Unique Macro
'

'
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("C3:C322").AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"U3:U322"), Unique:=True
ActiveWindow.SmallScroll Down:=-24
Range("X12").Select
End Sub


"Sean Timmons" wrote:

May help to see the macro code...

"cranen" wrote:

I am having problems with a recorded macro:

Raw Data on Sheet 1:

C
3 424a356
4 424a356
5 424a356
6 424b650
7 424b650
8 401b000
9 401b000
10 407b000

Copy and Sorted by Unique Value on Sheet 2:

A
2 424a356
3 424a356
4 424b650
5 401b100
6 407b000

Even though I request unique values, it continues to copy the top two values
which are the same. It has something to do with a header, maybe? Is there
some code that could get me around this problem? Your help is greatly
appreciated. Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Copy and Sort Unique Problem

Can the header be a blank row?

"Dave Peterson" wrote:

I bet you're using data|filter|advanced filter?

If that's true, then advanced filter has to have a header.

If you can't insert a header row (with a dummy header) in the original data, you
coul copy the column, paste to a new sheet, insert the header, do the advanced
filter, move the data to its final home.





cranen wrote:

I am having problems with a recorded macro:

Raw Data on Sheet 1:

C
3 424a356
4 424a356
5 424a356
6 424b650
7 424b650
8 401b000
9 401b000
10 407b000

Copy and Sorted by Unique Value on Sheet 2:

A
2 424a356
3 424a356
4 424b650
5 401b100
6 407b000

Even though I request unique values, it continues to copy the top two values
which are the same. It has something to do with a header, maybe? Is there
some code that could get me around this problem? Your help is greatly
appreciated. Thanks.


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copy and Sort Unique Problem

It looks like that would work.

Did it work for you when you tested it?

cranen wrote:

Can the header be a blank row?

"Dave Peterson" wrote:

I bet you're using data|filter|advanced filter?

If that's true, then advanced filter has to have a header.

If you can't insert a header row (with a dummy header) in the original data, you
coul copy the column, paste to a new sheet, insert the header, do the advanced
filter, move the data to its final home.





cranen wrote:

I am having problems with a recorded macro:

Raw Data on Sheet 1:

C
3 424a356
4 424a356
5 424a356
6 424b650
7 424b650
8 401b000
9 401b000
10 407b000

Copy and Sorted by Unique Value on Sheet 2:

A
2 424a356
3 424a356
4 424b650
5 401b100
6 407b000

Even though I request unique values, it continues to copy the top two values
which are the same. It has something to do with a header, maybe? Is there
some code that could get me around this problem? Your help is greatly
appreciated. Thanks.


--

Dave Peterson


--

Dave Peterson
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
Copy and Sort Unique cranen Excel Discussion (Misc queries) 2 August 17th 09 03:40 PM
Attempting to sort unique/only count first record in each unique g MJW[_2_] Excel Discussion (Misc queries) 3 August 10th 07 02:56 PM
how do I find and sort unique values from a column spreadsheet monkey Excel Worksheet Functions 1 March 28th 07 08:39 AM
How to Sort by Count the Max nos of Unique text values in Pivot Ta ToExcelAtExcel Excel Discussion (Misc queries) 1 November 7th 06 08:45 AM
How do I sort a column a unique number? ChelleA Excel Worksheet Functions 7 February 19th 05 10:38 AM


All times are GMT +1. The time now is 06:34 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"