VBA Tidying up help
Posted by Ian Mac on January 30, 2002 4:50 AM
All,
I have the following two Subs for each day of the week:
Private Sub CloseSunday_Click()
Application.ScreenUpdating = False
Sheets("TeamTotalsSun").Visible = False
Sheets("Michelle Nicoll Sun").Visible = False
Sheets("Robin Ellis Sun").Visible = False
Sheets("Caroline Swinhoe Sun").Visible = False
Sheets("Mark Farrow Sun").Visible = False
Sheets("Russell Haynes Sun").Visible = False
Sheets("Ian McAnena Sun").Visible = False
Sheets("Nick Renfern Sun").Visible = False
Sheets("Hamid Toghyan Sun").Visible = False
Sheets("Steven Morton Sun").Visible = False
Sheets("WeeklySummarySheet").Select
Application.ScreenUpdating = True
End Sub
Private Sub PrintSun_Click()
Sheets(Array("TeamTotalsSun", "Michelle Nicoll Sun", "Robin Ellis Sun", _
"Caroline Swinhoe Sun", "Mark Farrow Sun", "Russell Haynes Sun", _
"Ian McAnena Sun", "Nick Renfern Sun", "Hamid Toghyan Sun", _
"Steven Morton Sun")).Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
is there a way to have something similar (i.e. does the same thing) but stored in such a way that the user could select Monday from a list and run the code for sheets ending in Mon.
I'm trying to save on file size.
Many thanks
Ian Mac