ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba sorting stopped working (https://www.excelbanter.com/excel-programming/327244-vba-sorting-stopped-working.html)

Papa Jonah

vba sorting stopped working
 
I have been using the following code for several weeks, and it has worked
fine. All of a sudden, it is not sorting anymore. Any ideas what nuances I
need to check to verify are still in place? I don't recall messing with any
of this.

Range("y:AC").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Set pareto = table.Resize(fields, 5)

pareto.Select

Application.CutCopyMode = False
pareto.Sort Key1:=Range("AA2"), Order1:=xlDescending, Key2:=Range( _
"AC2"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom ', DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal 'x1SortNormal is default



TIA

Fredrik Wahlgren

vba sorting stopped working
 

"Papa Jonah" wrote in message
...
I have been using the following code for several weeks, and it has worked
fine. All of a sudden, it is not sorting anymore. Any ideas what nuances

I
need to check to verify are still in place? I don't recall messing with

any
of this.

Range("y:AC").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks

_
:=False, Transpose:=False

Set pareto = table.Resize(fields, 5)

pareto.Select

Application.CutCopyMode = False
pareto.Sort Key1:=Range("AA2"), Order1:=xlDescending, Key2:=Range( _
"AC2"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,

MatchCase _
:=False, Orientation:=xlTopToBottom ', DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal 'x1SortNormal is default



TIA


What happens? Do you get an error message? Can you sort manually?

/Fredrik



Papa Jonah

vba sorting stopped working
 
I don't get any error messages. The code continues to generate a chart. It
just isn't sorted.

"Fredrik Wahlgren" wrote:


"Papa Jonah" wrote in message
...
I have been using the following code for several weeks, and it has worked
fine. All of a sudden, it is not sorting anymore. Any ideas what nuances

I
need to check to verify are still in place? I don't recall messing with

any
of this.

Range("y:AC").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks

_
:=False, Transpose:=False

Set pareto = table.Resize(fields, 5)

pareto.Select

Application.CutCopyMode = False
pareto.Sort Key1:=Range("AA2"), Order1:=xlDescending, Key2:=Range( _
"AC2"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,

MatchCase _
:=False, Orientation:=xlTopToBottom ', DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal 'x1SortNormal is default



TIA


What happens? Do you get an error message? Can you sort manually?

/Fredrik




Fredrik Wahlgren

vba sorting stopped working
 

"Papa Jonah" wrote in message
...
I don't get any error messages. The code continues to generate a chart.

It
just isn't sorted.


What about "manual" sorting, i.e. Data|Sort?

/Fredrik



Fredrik Wahlgren

vba sorting stopped working
 

"Papa Jonah" wrote in message
...
That defeats the intent of having vba code.

If you want, you can send the workbook to me and I will see if it works OK
on my PC.

/Fredrik



robbg0326

vba sorting stopped working
 
I encountered this same problem. I created a macro on one computer an
when I tried to use it on another terminal on our network it would no
run. I found that removing the code "DataOption1:=x1SortNormal" solve
the problem


Myrna Larson

vba sorting stopped working
 
I think that the option is xlSortNormal (the letter "l", not the digit "1").

On Tue, 19 Apr 2005 00:31:56 -0500, lid
(robbg0326) wrote:

I encountered this same problem. I created a macro on one computer and
when I tried to use it on another terminal on our network it would not
run. I found that removing the code "DataOption1:=x1SortNormal" solved
the problem.




All times are GMT +1. The time now is 11:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com