im copy my 5 workin days into a new file the i ask the user to enter a class and iv to loop throught my workbook and delete all the classes that the person is in...
here some of my code but im badly stuck
i can copy all my files into a new work book. but just the looping and then delete is the problem
Dim g, block, start As Range
Dim ws As Worksheet
Dim class As String
Const maxrooms = 13
Const maxhours = 9
class = InputBox("Enter Class")
'if it is not the class selected then delete
Set start = Range("B3")
Set block = Range(start, start.Offset(maxhours - 1, maxrooms - 1))
For Each g In block
g.Activate
Next g
If Value = class Then Copy
Otherwise Delete
'and then loop through the 5 days of the week
For Each ws In Worksheets
ws.Activate
Next ws
here some of my code but im badly stuck
i can copy all my files into a new work book. but just the looping and then delete is the problem
Dim g, block, start As Range
Dim ws As Worksheet
Dim class As String
Const maxrooms = 13
Const maxhours = 9
class = InputBox("Enter Class")
'if it is not the class selected then delete
Set start = Range("B3")
Set block = Range(start, start.Offset(maxhours - 1, maxrooms - 1))
For Each g In block
g.Activate
Next g
If Value = class Then Copy
Otherwise Delete
'and then loop through the 5 days of the week
For Each ws In Worksheets
ws.Activate
Next ws