Hi guys,
I've been doing some googling and searching on this forum and I can't quite find the answer I need.
So here's the situation:
I have a spreadsheet of students in tutor groups (about 15 students).
First worksheet is the summary sheet and gathers together data based on the data in the individual student worksheets.
Each student worksheet has a daily record: a grid of scores each day over an 8 week period.
I have named ranges on each student worksheet (week1, week2, etc.)
Up until now I've used the following code, operated by a click button on each student sheet to hide everything except the current week for data entry:
The complaint from teachers using this is that they get confused if they have to keep clicking the "Show" button on each sheet in turn.
I've been struggling to find a way to make one button, on the first sheet, operate the macro to hide the appropriate rows on all sheets in the workbook.
Does anyone have any ideas?
Cheers,
J
I've been doing some googling and searching on this forum and I can't quite find the answer I need.
So here's the situation:
I have a spreadsheet of students in tutor groups (about 15 students).
First worksheet is the summary sheet and gathers together data based on the data in the individual student worksheets.
Each student worksheet has a daily record: a grid of scores each day over an 8 week period.
I have named ranges on each student worksheet (week1, week2, etc.)
Up until now I've used the following code, operated by a click button on each student sheet to hide everything except the current week for data entry:
Code:
Sub ShowWeek1()
If InStr(1, ActiveSheet.Range("J2").Value, "1") > 0 Then
Range("Week1").EntireRow.Hidden = False
Else
Range("Week1").EntireRow.Hidden = True
End If
If InStr(1, ActiveSheet.Range("J2").Value, "2") > 0 Then
Range("Week2").EntireRow.Hidden = False
Else
Range("Week2").EntireRow.Hidden = True
End If
If InStr(1, ActiveSheet.Range("J2").Value, "3") > 0 Then
Range("Week3").EntireRow.Hidden = False
Else
Range("Week3").EntireRow.Hidden = True
End If
If InStr(1, ActiveSheet.Range("J2").Value, "4") > 0 Then
Range("Week4").EntireRow.Hidden = False
Else
Range("Week4").EntireRow.Hidden = True
End If
If InStr(1, ActiveSheet.Range("J2").Value, "5") > 0 Then
Range("Week5").EntireRow.Hidden = False
Else
Range("Week5").EntireRow.Hidden = True
End If
If InStr(1, ActiveSheet.Range("J2").Value, "6") > 0 Then
Range("Week6").EntireRow.Hidden = False
Else
Range("Week6").EntireRow.Hidden = True
End If
If InStr(1, ActiveSheet.Range("J2").Value, "7") > 0 Then
Range("Week7").EntireRow.Hidden = False
Else
Range("Week7").EntireRow.Hidden = True
End If
If InStr(1, ActiveSheet.Range("J2").Value, "8") > 0 Then
Range("Week8").EntireRow.Hidden = False
Else
Range("Week8").EntireRow.Hidden = True
End If
End Sub
The complaint from teachers using this is that they get confused if they have to keep clicking the "Show" button on each sheet in turn.
I've been struggling to find a way to make one button, on the first sheet, operate the macro to hide the appropriate rows on all sheets in the workbook.
Does anyone have any ideas?
Cheers,
J