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

I have a list of item numbers in column €œC€ on Sheet 1. There are multiple
item numbers that are the same. In fact, the first two and sometimes more
are the exact same item number. My Summary Sheet (Sheet 2) is used to
calculate a quantity using a SUMIF statement dependent on the item number.
Well, I tried using a macro to copy and sort the unique values from column
€œC€ on sheet 1 to my Summary Sheet, but it continues to copy the top two
values which are the exact same. When this happens, it is messing up my
summary sheet. What is the best way to fix this? I appreciate your help.
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 79
Default Copy and Sort Unique

On 13 Ago, 23:24, cranen wrote:
I have a list of item numbers in column “C” on Sheet 1. *There are multiple
item numbers that are the same. *In fact, the first two and sometimes more
are the exact same item number. *My Summary Sheet (Sheet 2) is used to
calculate a quantity using a SUMIF statement dependent on the item number.. *
Well, I tried using a macro to copy and sort the unique values from column
“C” on sheet 1 to my Summary Sheet, but it continues to copy the top two
values which are the exact same. *When this happens, it is messing up my
summary sheet. *What is the best way to fix this? *I appreciate your help. *
Thanks.


Hi cranen.
I dont know what is the best way, but try:

Public Sub prova()
Dim x As Long, y As Long
Sheets(1).Select
y = Range("C1").End(xlDown).Row
Range("C1").FormulaLabel = xlColumnLabels
Range("C1:C" & y & "").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Sheets(2).Range("A1"), Unique:=True
Sheets(2).Select
x = Range("A1").End(xlDown).Row
Range("A1:A" & x & "").Sort Key1:=Range("A1"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Range("A1").Select
End Sub

Change with your references and let us know.
Regards
Eliano
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Copy and Sort Unique

I tried plugging in my references, and I didn't have any luck. I might have
confused you with my previous request. All I need is a macro that copies and
sorts unique values from one column to a column in another worksheet without
copying the second value if it is the same as the first value. Thanks for
your help.

"eliano" wrote:

On 13 Ago, 23:24, cranen wrote:
I have a list of item numbers in column €œC€ on Sheet 1. There are multiple
item numbers that are the same. In fact, the first two and sometimes more
are the exact same item number. My Summary Sheet (Sheet 2) is used to
calculate a quantity using a SUMIF statement dependent on the item number..
Well, I tried using a macro to copy and sort the unique values from column
€œC€ on sheet 1 to my Summary Sheet, but it continues to copy the top two
values which are the exact same. When this happens, it is messing up my
summary sheet. What is the best way to fix this? I appreciate your help.
Thanks.


Hi cranen.
I dont know what is the best way, but try:

Public Sub prova()
Dim x As Long, y As Long
Sheets(1).Select
y = Range("C1").End(xlDown).Row
Range("C1").FormulaLabel = xlColumnLabels
Range("C1:C" & y & "").AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=Sheets(2).Range("A1"), Unique:=True
Sheets(2).Select
x = Range("A1").End(xlDown).Row
Range("A1:A" & x & "").Sort Key1:=Range("A1"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
Range("A1").Select
End Sub

Change with your references and let us know.
Regards
Eliano

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
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
copy only unique values Sweetetc Excel Worksheet Functions 2 April 3rd 06 10:42 PM
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 12:18 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"