I've made a workbook with 13 Worksheets in it.
The first 12 are the months (Jan, Feb, Mar......)
The last one is a daily report (Sport).
The code starts in Worksheet(Sport)
Depending which day it's now (18-2-2008) the code has to go to the right month (Feb) and the right day (18) and copying a specific range.
The problem is that he goes to the right month but he copies the range from Worksheet(Sport).
The first 12 are the months (Jan, Feb, Mar......)
The last one is a daily report (Sport).
The code starts in Worksheet(Sport)
Depending which day it's now (18-2-2008) the code has to go to the right month (Feb) and the right day (18) and copying a specific range.
The problem is that he goes to the right month but he copies the range from Worksheet(Sport).
Code:
Private Sub Sportrooster()
Dim Day As Long
Dim Month As Long
Day = Range("J3") + 8
Month = Range("J4")
If Month = 1 Then
Worksheets("Jan").Select
Range(Cells(17, Day), Cells(130, Day)).Copy
Sheets("Sport").Select
Range("G11").Select
ActiveSheet.Paste
Else
If Month = 2 Then
Worksheets("Feb").Select
Range(Cells(17, Day), Cells(130, Day)).Copy
Sheets("Sport").Select
Range("G11").Select
ActiveSheet.Paste
Else
If Month = 3 Then
Worksheets("Mar").Select
Range(Cells(17, Day), Cells(130, Day)).Copy
Sheets("Sport").Select
Range("G11").Select
ActiveSheet.Paste
Else
Exit Sub
End If
End If
End If
End Sub