marreco
11-04-2012, 08:09 AM
Hi.
The code below should run on the worksheet "Motivos_Calc" but I'm having an error at runtime
Sub CopySort()
Sheets("Motivos_Calc").Range("G1:I11").Copy Destination:=Sheets("Motivos_Calc").Range("K1")
Range("K1:M11").Select
Call SortUniq
End Sub
Sub SortUniq()
With Sheets("Motivos_Calc").Sort
.SortFields.Clear
.SortFields.Add Range("L1"), xlSortOnValues, xlAscending
.SortFields.Add Range("K1")
.SetRange ActiveSheet.Cells(1).CurrentRegion
.Header = xlYes
.Apply <--Erro 1004
End With
End Sub
Run-time error '1004 ':
The reference classification is not valid. sure if the reference
is among the data you want to sort and box the first
Sort is the same or is blank
The code below should run on the worksheet "Motivos_Calc" but I'm having an error at runtime
Sub CopySort()
Sheets("Motivos_Calc").Range("G1:I11").Copy Destination:=Sheets("Motivos_Calc").Range("K1")
Range("K1:M11").Select
Call SortUniq
End Sub
Sub SortUniq()
With Sheets("Motivos_Calc").Sort
.SortFields.Clear
.SortFields.Add Range("L1"), xlSortOnValues, xlAscending
.SortFields.Add Range("K1")
.SetRange ActiveSheet.Cells(1).CurrentRegion
.Header = xlYes
.Apply <--Erro 1004
End With
End Sub
Run-time error '1004 ':
The reference classification is not valid. sure if the reference
is among the data you want to sort and box the first
Sort is the same or is blank