I can't edit a sort macro which sort a column in worksheet, my code like this:
Worksheets(Worksheets("txtChecker").Cells(5, 2).Text).Select
Worksheets(Worksheets("txtChecker").Cells(5, 2).Text).Rows(Worksheets("txtChecker").Cells(1, 2).Text & ":" & Worksheets("txtChecker").Cells(2, 2).Text).Select
Selection.Sort Key1:=Range("A" & Worksheets("txtChecker").Cells(1, 2).Text), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
==============
Worksheet(txtChecker) is using for user writting their sort row and column and worksheet. But it doesn't work at all and the error msg is:
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.
Worksheets(Worksheets("txtChecker").Cells(5, 2).Text).Select
Worksheets(Worksheets("txtChecker").Cells(5, 2).Text).Rows(Worksheets("txtChecker").Cells(1, 2).Text & ":" & Worksheets("txtChecker").Cells(2, 2).Text).Select
Selection.Sort Key1:=Range("A" & Worksheets("txtChecker").Cells(1, 2).Text), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
==============
Worksheet(txtChecker) is using for user writting their sort row and column and worksheet. But it doesn't work at all and the error msg is:
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.