Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Copying data to another sheet and sorting it automatically

I've now sent them a file containing macros to do both sorts. They do have a
couple draw backs that may need to be addressed.

1) User will need to be on original sheet when selecting the controls.

2) Poor control face id's.

Sub Macro1()
Range("C:D,Y:Y,Z:Z,AA:AA").Select
Selection.Copy
Sheets.Add
ActiveSheet.Paste
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Key2:=Range("D1") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
End Sub

Sub Macro2()
Range("D:D,Y:Y,AA:AA").Select
Selection.Copy
Sheets.Add
ActiveSheet.Paste
Selection.Sort Key1:=Range("C1"), Order1:=xlAscending, Key2:=Range("B1") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
End Sub



"Christmas May" wrote:

I'm not sure how experienced they are. Therefore, I've emailed them an Excel
file with a "command bar control" so all they would need to do is click it to
run the following code. If this goes well for them me and this group should
continue on to solve the remainder of her problem.

Range("C:D,Y:Y,Z:Z,AA:AA").Select
Selection.Copy
Sheets.Add
ActiveSheet.Paste
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Key2:=Range("D1") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom

" wrote:

I have a question about programming a sort function for data from a
sporting event. I am not sure where to ask the question, but I would
really appreciate some help. I posted it on the base newsgroup too -
please forgive the multiple posts.

I would like to read data on one page, automatically sort it, and print
it on another worksheet in the same workbook without changing the data
on the original page. This is information for an announcer at a
sporting event, and I do not want the announcer to have to do manual
excel operations, but I could use a button for a VB sort if I had to.
I would prefer not to.

Here is the scenario. I have several columns of data on the second
worksheet in a workbook. The data is in columns C, Column D, Column Y,
and column Z. The data in each of these columns has been calculated
from data entered manually at the sporting event into the first
worksheet in the workbook.

I need to take these four columns of data from the second page to the
third page of the workbook, and display it in sorted order, with the
sorting based on the numeric data in column Z. Then I need to take it
to the fourth page, and display it sorted based on the numeric data in
column AA.

Here is an example of the way the data is displayed on the 2nd
Worksheet;

Column C Column D Column Y Column Z ColumnAA

GROUP NAME SCORE RANK IN GROUP OVERALL RANK

Group A Jones 22.5 6 8
Group A Smith 22.9 5 7
Group A Kelly 50 2 2
Group A Brown 44 4 4
Group A White 50 2 2
Group A Scarlet 65 1 1
Group B Tommy 33 2 6
Group B Jane 44 1 4

Here is how I would like to have it displayed on the third worksheet -
sorted by group and then by rank in the group. When there is a tie, I
do not care which name comes first.

GROUP NAME SCORE RANK IN GROUP

Group A Scarlett 65 1
Group A White 50 2
Group A Kelly 50 2
Group A Brown 44 4
Group A Smith 22.9 5
Group A Jones 22.5 6

Group B Jane 44 1
Group B Tommy 33 2


I would also like to have it displayed on the 4th worksheet like this;

NAME SCORE OVERALL RANK

Scarlett 65 1
White 50 2
Kelly 50 2
Brown 44 4
Jane 44 4
Tommy 33 6
Smith 22.9 7
Jones 22.5 8

Once again, when there is a tie, I do not care which name is first. I
know there is a way to do this, but I need help. I am a beginner at
best, but I am learning. Can anyone help me with the code?

Thanks in advance.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data sorting automatically? Tommy[_2_] Excel Worksheet Functions 10 March 24th 07 10:09 PM
Sorting and copying automatically between worksheets nadia New Users to Excel 2 February 12th 06 10:18 PM
Copying (Master) column to another sheet to automatically update LostInVirtualSpace Excel Worksheet Functions 0 September 19th 05 06:57 PM
Automatically copying specified rows from a sheet to another Ossi Hannula Excel Programming 2 January 13th 05 02:21 AM
Sorting data automatically scottwilsonx[_34_] Excel Programming 1 September 23rd 04 12:54 PM


All times are GMT +1. The time now is 09:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"