Excel Excel Macro error code 1004

Joined
Jun 1, 2008
Messages
3
Reaction score
0


.In a bridge tournament each team plays 8 rounds (eight other couples).

.the spread sheet uses column A to list all teams (from 1 to x). There could be

as many as 25 teams.

.After each round each teams score in entered in that rounds column .

For example after the first round each teams score is entered in column C







A B C D E F G H I J K



________________ROUND_____________



Team # Names 1 2 3 4 5 6 7 8 Total Score

1 joe-sandy 1650 1650

2 al-sally 980 980

3 tom-ann 1100 1100





When all scores are entered the spread sheet (score sheet) is sorted in

descending order by column K (total score of each team) and posted on a

Bulletin board. This shows every team their relative position (1 place, 2 place, etc.

to last place).

.This means that there will be 8 series of entering scores onto a master spread

sheet and 8 sorts showing every teams position after each round. (rounds 1,2,3,4,5,6,7 & 8(final))



The problem is that if the scorekeeper saves the worksheet after sorting and/or printing, then the original listing is no longer numerical by Team #, but is sorted by the

last order of Total Score. In other words, the worksheet has to begin each round sorted by Team # so that the scorekeeper can more easily enter each teams score

for that round.



Now for my question..Can a macro be developed that the scorekeeper activates (after all scores have been entered for a given round) with a keypunch that automatically sorts by column K, then prints and then returns the worksheet to the original sort?



When I try to run a micro to save the original input, sort by score order, print and return to the unsorted worksheet I get a runtime erro '1004' that says "sort method of range class failed. the following is the code.

Sub sort()
'
' sort Macro
' Macro recorded 6/15/2008 by JOE TEMPLER
'

' ActiveWindow.ScrollRow=35
ActiveWindow.ScrollRow=34
.
.all the way down to
.
ActiveWindow.ScrollRow=1

ActiveWorkbook.Save
Selection.sort Key1:=Range("K3"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub


Can you help?

Thanks in advance.

(e-mail address removed)
 

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