sorting with macros

G

Guest

I created a employee schedule and i dont want people adding rows and such to
i locked all cell except for the names of the employees which are list under
column A.
I set up a macros so that all the user has to do is add new employees at the
next availible row and delete any employees that have left. Then press a
macros button and the names list in column A sort in ABC order. The problem
is that when i set the macros it sorts correctly, and then i push the macros
button that i assigned it to and it does nothing. The strange thing is that
it works on other worksheet in the same workbook.
here is the code for the unworking macros.



Sub sortconc()
'
' sortconc Macro
' Macro recorded 1/31/2005 by palace
'

'
Range("A7:A80").Select
Selection.Sort Key1:=Range("A8"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A7").Select
End Sub


and here is the code that works for another sheet


Sub sortbox()
'
' sortbox Macro
' Macro recorded 5/5/2004 by Muvico Employee
'

'
Range("A7:A36").Select
Selection.Sort Key1:=Range("A7"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A7").Select
End Sub


any help would be great.

scott
 
B

Bob Phillips

Nothing obvious to me but I suggest you explicitly qualify the worksheet,
such as

Worksheets("Data Sheet").Range(A7:A80").Select

etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top