C
caldog
I have several worksheets, that I need to sort. My idea was to put a button
on what I call my 'input page' and sort each of these pages. But I get the
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."
Now on sheet 1 is where the button is. Information that is to be sorted is
on sheet2, sheet3 sheet 4 and etc.
Sort code is:
Private Sub Sort1()
ActiveSheet.Range("A214").Select
Selection.Sort Key1:=Range("A2"),Order:=xlAscending, Header:=xlNo,
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopTobottom,
DataOption1:=xlSortNormal
End Sub
Private Sub Main Button1()
'This is tied to main button on sheet 1
Sheets("Sheet 2").Select
Call Sort1
Sheets("Sheet 3").Select
Call Sort 1
End sub
Each range in each sheet will be the same. The error comes when I try to
call Sort1.
Can you folks give some help in letting me know what I am doing wrong.
Steve
on what I call my 'input page' and sort each of these pages. But I get the
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."
Now on sheet 1 is where the button is. Information that is to be sorted is
on sheet2, sheet3 sheet 4 and etc.
Sort code is:
Private Sub Sort1()
ActiveSheet.Range("A214").Select
Selection.Sort Key1:=Range("A2"),Order:=xlAscending, Header:=xlNo,
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopTobottom,
DataOption1:=xlSortNormal
End Sub
Private Sub Main Button1()
'This is tied to main button on sheet 1
Sheets("Sheet 2").Select
Call Sort1
Sheets("Sheet 3").Select
Call Sort 1
End sub
Each range in each sheet will be the same. The error comes when I try to
call Sort1.
Can you folks give some help in letting me know what I am doing wrong.
Steve