VBA Speed Sort ?

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
653
Hi All,

I could of course record a macro but I have the need for speed.

How can I speed up my sorting job via written code versus a scripted code?

I'm using Excel 2013 & I want to quicken my sort criteria:
-expanded selection Columns C:2 to Column V:573
-not in deleting duplicates
-by Column G from smallest to highest

Many thanks in advance.

R/
Pin

:confused:
 

Some videos you may like

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Arithos

Well-known Member
Joined
Aug 14, 2014
Messages
598
Hi All,

I could of course record a macro but I have the need for speed.

How can I speed up my sorting job via written code versus a scripted code?

I'm using Excel 2013 & I want to quicken my sort criteria:
-expanded selection Columns C:2 to Column V:573
-not in deleting duplicates
-by Column G from smallest to highest

Many thanks in advance.

R/
Pin

:confused:

It should not be that slow tho, should it? That is usually not the part im worried about going to "slow".

Do you however need the range C2:V573 beeing dynamic? or will it always be this selection?
 

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
653
Hi Sturla,

It will always be this selection. I just would like to see if there was a written VBA to accomplish this task.

Can you provide a code for this?

Thanks,
Pin
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,770
Office Version
  1. 2010
Platform
  1. Windows
Code:
Range("C2:V753").Sort Key1:=Range("G2")
 

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
653

ADVERTISEMENT

Wow shg,

I'm going to try this out ASAP! Thanks, I'm under the assumption that this will sort from 'smallest to largest'.

Many Thanks,
Pin
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,770
Office Version
  1. 2010
Platform
  1. Windows
You're welcome.
 

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
653
Hey 'shg',

I know its been awhile, but do you also know how to also sort by 'A' to 'Z'?

If 'Range("C2:V753").Sort Key1:=Range("G2")' sorts by 'smallest' to 'largest'?

Many thanks,

Pin
 

Watch MrExcel Video

Forum statistics

Threads
1,108,990
Messages
5,526,096
Members
409,685
Latest member
Bellybb

This Week's Hot Topics

Top