I'm new to the MACRO and new a little help with a problem I'm having.
I have two wokbooks one called CFLDATABASE where have a list of all CFL game scores since 2000; my second workbook is called CFLSC where I copaer the ast scores to predict the outcome of current games. I need te MACR to go down COL"A" in the CFLC workbook seect the firts team and then go to the CFLDATABASE WORKBOOK AND
1. Filter for the selected team
2. Filterfor the opp
3. Past only the last three game results
4. Copy the date back to a specfic area of the CFLSC workbook.
Then go to he next team unntil the wees scheduled gamesis complete.
This is the code I hace so Far:
Sub CFL()
'
' CFL Macro
' CFL Macro recorded 7/23/2007 by Wade Dues
'ChDir "I:\"
Workbooks.Open Filename:="I:\CFL DATABASE.xls"
ActiveWindow.WindowState = xlNormal
Workbooks.Open Filename:="I:\CFLSC.xls"
Selection.AutoFilter Field:=2, Criteria1:="Blanks"
Sheets("SCHEDULE").Select
Selection.AutoFilter Field:=2, Criteria1:="5"
Selection.AutoFilter Field:=4, Criteria1:="Montreal"
Range("D2").Select
Selection.Copy
End Sub
I have attached a sample of both work sheets...thanks in advance
In the example: I would need to go tothe databaseane lookup EDM in the database and filte ofr the OPPONENT BC ; select the last tree rows ony and retrn the value to the CFLSC workshhet. Then move don 3 rowsto the next team a repeat the process until the weeks game schedule s complete...HELP!
CFLDATABASE
YR WK L TEAM OPP 1Q 2Q
2007 WK1 A BC Toronto 7 3
2007 WK1 H Toronto BC 0 15
2007 WK1 A Winnipeg Edmonton 7 14
2007 WK1 H Edmonton Winnipeg 15 7
2007 WK1 A Saskatchewan Montreal 0 6
2007 WK1 H Montreal Saskatchewan 2 0
2007 WK1 A Hamilton Calgary 3 3
CFLSC workook
YR WK C L TEAM OPP PS L
2000 WK4
2000 WK4
2000 WK4
2000 WK4 B A EDM BC 36 1.0
2000 WK4
2000 WK4
2000 WK4
2000 WK4 B H BC EDM 25 -1.0
2000 WK4
2000 WK4
2000 WK4
2000 WK4 W A HAM TOR 29 0.0
2000 WK4
2000 WK4
2000 WK4
2000 WK4 W H TOR HAM 27 0.0
[/b]
I have two wokbooks one called CFLDATABASE where have a list of all CFL game scores since 2000; my second workbook is called CFLSC where I copaer the ast scores to predict the outcome of current games. I need te MACR to go down COL"A" in the CFLC workbook seect the firts team and then go to the CFLDATABASE WORKBOOK AND
1. Filter for the selected team
2. Filterfor the opp
3. Past only the last three game results
4. Copy the date back to a specfic area of the CFLSC workbook.
Then go to he next team unntil the wees scheduled gamesis complete.
This is the code I hace so Far:
Sub CFL()
'
' CFL Macro
' CFL Macro recorded 7/23/2007 by Wade Dues
'ChDir "I:\"
Workbooks.Open Filename:="I:\CFL DATABASE.xls"
ActiveWindow.WindowState = xlNormal
Workbooks.Open Filename:="I:\CFLSC.xls"
Selection.AutoFilter Field:=2, Criteria1:="Blanks"
Sheets("SCHEDULE").Select
Selection.AutoFilter Field:=2, Criteria1:="5"
Selection.AutoFilter Field:=4, Criteria1:="Montreal"
Range("D2").Select
Selection.Copy
End Sub
I have attached a sample of both work sheets...thanks in advance
In the example: I would need to go tothe databaseane lookup EDM in the database and filte ofr the OPPONENT BC ; select the last tree rows ony and retrn the value to the CFLSC workshhet. Then move don 3 rowsto the next team a repeat the process until the weeks game schedule s complete...HELP!
CFLDATABASE
YR WK L TEAM OPP 1Q 2Q
2007 WK1 A BC Toronto 7 3
2007 WK1 H Toronto BC 0 15
2007 WK1 A Winnipeg Edmonton 7 14
2007 WK1 H Edmonton Winnipeg 15 7
2007 WK1 A Saskatchewan Montreal 0 6
2007 WK1 H Montreal Saskatchewan 2 0
2007 WK1 A Hamilton Calgary 3 3
CFLSC workook
YR WK C L TEAM OPP PS L
2000 WK4
2000 WK4
2000 WK4
2000 WK4 B A EDM BC 36 1.0
2000 WK4
2000 WK4
2000 WK4
2000 WK4 B H BC EDM 25 -1.0
2000 WK4
2000 WK4
2000 WK4
2000 WK4 W A HAM TOR 29 0.0
2000 WK4
2000 WK4
2000 WK4
2000 WK4 W H TOR HAM 27 0.0
[/b]