![]() |
Sorting issue
I am trying to sort three seperate arrays using the following code:
'Overhead broken down by site 'Denver OVHsite.Range("E4").Copy DataWks.Range("J28").PasteSpecial Paste:=xlValues 'Coastal OVHsite.Range("O4").Copy DataWks.Range("K28").PasteSpecial Paste:=xlValues 'Orem OVHsite.Range("J4").Copy DataWks.Range("L28").PasteSpecial Paste:=xlValues 'Overhead broken down by exception 'Denver OVHsite.Range("D7:D13").Copy DataWks.Range("N4").PasteSpecial Paste:=xlValues 'Coastal OVHsite.Range("N7:N13").Copy DataWks.Range("P4").PasteSpecial Paste:=xlValues 'Orem OVHsite.Range("I7:I13").Copy DataWks.Range("R4").PasteSpecial Paste:=xlValues 'Sort Ovh DataWks.Range("N4:O10").sort Key1:=Range("N4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom DataWks.Range("P4:Q10").sort Key1:=Range("P4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom DataWks.Range("R4:S10").sort Key1:=Range("R4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom I am receiving the following error: Run-time error '1004': The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank. What am I doing wrong? Any help would be appriciated....Thanks! -- EW - Analyst |
Sorting issue
My guess is that the DataWks sheet is not the active sheet.
The Key1 ranges all refer to the active sheet. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "ewagz" wrote in message I am trying to sort three seperate arrays using the following code: 'Overhead broken down by site 'Denver OVHsite.Range("E4").Copy DataWks.Range("J28").PasteSpecial Paste:=xlValues 'Coastal OVHsite.Range("O4").Copy DataWks.Range("K28").PasteSpecial Paste:=xlValues 'Orem OVHsite.Range("J4").Copy DataWks.Range("L28").PasteSpecial Paste:=xlValues 'Overhead broken down by exception 'Denver OVHsite.Range("D7:D13").Copy DataWks.Range("N4").PasteSpecial Paste:=xlValues 'Coastal OVHsite.Range("N7:N13").Copy DataWks.Range("P4").PasteSpecial Paste:=xlValues 'Orem OVHsite.Range("I7:I13").Copy DataWks.Range("R4").PasteSpecial Paste:=xlValues 'Sort Ovh DataWks.Range("N4:O10").sort Key1:=Range("N4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom DataWks.Range("P4:Q10").sort Key1:=Range("P4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom DataWks.Range("R4:S10").sort Key1:=Range("R4"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom I am receiving the following error: Run-time error '1004': The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank. What am I doing wrong? Any help would be appriciated....Thanks! -- EW - Analyst |
All times are GMT +1. The time now is 12:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com