Is it possible to paste sorted unique values?

MPW

Well-known Member
Joined
Oct 7, 2009
Messages
571
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Using XP with Office 2003

Currently I am copying 3 columns to a new location(one column is not next to the other two).
Next I use an AdvancedFilter to copytorange a unique list to a 2nd sheet. Last of all the list is sorted.

The clean up involves clearing the 1st 3 columns that I used for the unique list and also reformatting the list that was created since it brought the original formatting with it.

The process works but it takes too long. I would like to combine the processes.

Is it possible to do this all in one step?
Is it possible to do the advancedfilter copy with just values so I don't have to reformat the cells?
Is it possible to do the advancedfilter copy from columns that are not next to each other?

Any Ideas for some or all of the answers?

MPW
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
MPW

Are you using code for this?

If you are please post it.
 
Upvote 0
Here is part of the code
Code:
Sheets("Script").Range("E56:F5692").Copy

Sheets("Script").Range("AA56").PasteSpecial Paste:=xlPasteValues, _
operation:=xlNone, skipblanks:=False, Transpose:=False

Sheets("Script").Range("J56:J5692").Copy

Sheets("Script").Range("AC56").PasteSpecial Paste:=xlPasteValues, _
operation:=xlNone, skipblanks:=False, Transpose:=False
    
Sheets("Script").Range("AA56:AC5692").AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=Sheets("Stats").Range("R197"), _
Unique:=True

Sheets("Script").Range("AA56:AC5692").Clear

Sheets("Stats").Range("AF197:AF1080").Copy

Sheets("Stats").Range("B197:AE1080").PasteSpecial _
Paste:=xlPasteFormats, operation:=xlNone, skipblanks:=False, _
Transpose:=False

Sheets("Stats").Range("AF199").Copy

Sheets("Stats").Range("B199:AE1080").PasteSpecial _
Paste:=xlPasteFormats, operation:=xlNone, skipblanks:=False, _
Transpose:=False
    

Sheets("Stats").Range("R197:R1000").Sort Key1:=Range("R197"), _
Order1:=xlAscending, Header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
Some of these ranges are actually variables that are created on the fly but for clarity I put in actual range references.
 
Upvote 0
FYI
I tied to Copy over all the columns at once and the delete the columns that I didn't need. It actually doubled the amount of running time!
Back to the Drawing Board.
 
Upvote 0
I have found that unhiding the hidden rows does speed up the process but it is still too slow to be acceptable to most end users. If it is not possible to combine these functions does anyone have an alternate method?
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top