Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub NewGroupTask()
- '
- ' NewGroupTask Macro
- '
- '
- ' Unprotect sheet to allow editing
- ActiveSheet.Unprotect Password:="adminpw"
- ' Get information about new task and cancel if user cancelled inputbox
- Dim TaskNum As Variant
- TaskNum = InputBox("Enter the Task Number from the Gantt Chart", "Add New Group Task", 1)
- If TaskNum = vbNullString Then
- MsgBox ("You cancelled - the new group task won't be added.")
- Exit Sub
- End If
- Dim TaskDescription As Variant
- TaskDescription = InputBox("Enter the Task Description", "Add New Group Task", 1)
- If TaskDescription = vbNullString Then
- MsgBox ("You cancelled - the new group task won't be added.")
- Exit Sub
- End If
- Dim TaskWorkDays As Variant
- TaskWorkDays = InputBox("Enter the number of Work Days for this task", "Add New Group Task", 1)
- If TaskWorkDays = vbNullString Then
- MsgBox ("You cancelled - the new group task won't be added.")
- Exit Sub
- End If
- Dim TaskLink As Variant
- TaskLink = InputBox("Enter a working URL where the task can be found." & vbCrLf & vbCrLf & "Enter 'N/a' if there is no link." & vbCrLf & "or Enter '???' if you don't know where the link is.", "Add New Group Task", 1)
- If TaskLink = vbNullString Then
- MsgBox ("You cancelled - the new group task won't be added.")
- Exit Sub
- End If
- ' Create new task
- Range("B200").Select
- Selection.End(xlUp).Select
- Range(ActiveCell.Offset(-4, 0), ActiveCell.Offset(2, 17)).Select
- Selection.Copy
- ActiveCell.Offset(3, 0).Select
- ActiveCell.Offset(4, 0).Select
- ActiveSheet.Paste
- ActiveCell.Worksheet.Cells(ActiveCell.Row - 1, 1).EntireRow.Select
- Selection.RowHeight = 30
- ' Set task information based on what user entered
- ActiveCell.Offset(5, 1).Value = TaskNum
- ActiveCell.Offset(5, 2).Value = TaskDescription
- ActiveCell.Offset(5, 3).Value = TaskWorkDays
- ActiveCell.Offset(5, 4).Value = "?"
- ActiveCell.Offset(5, 5).Value = "?"
- ActiveCell.Offset(5, 6).Value = "?"
- ActiveCell.Offset(5, 7).Value = "?"
- ActiveCell.Offset(5, 10).Value = "...Enter your comments here..."
- ActiveCell.Offset(8, 12).Value = TaskLink
- ActiveCell.Offset(5, 0).Select
- ActiveCell.Worksheet.Cells(ActiveCell.Row, 1).EntireRow.Select
- Selection.RowHeight = 23.8
- ActiveCell.Offset(0, 10).Select
- ' - Update total (Cell G4) to include new task -
- Call UpdateGroupTotal
- ' Protect document
- ActiveSheet.Protect Password:="adminpw", DrawingObjects:=True, Contents:=True, Scenarios:=True
- End Sub
- Sub NewIndividualTask()
- '
- ' NewGroupTask Macro
- '
- '
- ' Unprotect sheet to allow editing
- ActiveSheet.Unprotect Password:="adminpw"
- ' Get information about new task and cancel if user cancelled inputbox
- Dim TaskNum As Variant
- TaskNum = InputBox("Enter the Task Number from the Gantt Chart", "Add New Group Task", 1)
- If TaskNum = vbNullString Then
- MsgBox ("You cancelled - the new group task won't be added.")
- Exit Sub
- End If
- Dim TaskDescription As Variant
- TaskDescription = InputBox("Enter the Task Description", "Add New Group Task", 1)
- If TaskDescription = vbNullString Then
- MsgBox ("You cancelled - the new group task won't be added.")
- Exit Sub
- End If
- Dim TaskWorkDays As Variant
- TaskWorkDays = InputBox("Enter the number of Work Days for this task", "Add New Group Task", 1)
- If TaskWorkDays = vbNullString Then
- MsgBox ("You cancelled - the new group task won't be added.")
- Exit Sub
- End If
- Dim TaskLink As Variant
- TaskLink = InputBox("Enter a working URL where the task can be found." & vbCrLf & vbCrLf & "Enter 'N/a' if there is no link." & vbCrLf & "or Enter '???' if you don't know where the link is.", "Add New Group Task", 1)
- If TaskLink = vbNullString Then
- MsgBox ("You cancelled - the new group task won't be added.")
- Exit Sub
- End If
- ' Create new task
- Range("B200").Select
- Selection.End(xlUp).Select
- Range(ActiveCell.Offset(-4, 0), ActiveCell.Offset(2, 17)).Select
- Selection.Copy
- ActiveCell.Offset(3, 0).Select
- ActiveCell.Offset(4, 0).Select
- ActiveSheet.Paste
- ActiveCell.Worksheet.Cells(ActiveCell.Row - 1, 1).EntireRow.Select
- Selection.RowHeight = 30
- ' Set task information based on what user entered
- ActiveCell.Offset(5, 1).Value = TaskNum
- ActiveCell.Offset(5, 2).Value = TaskDescription
- ActiveCell.Offset(5, 3).Value = TaskWorkDays
- ActiveCell.Offset(5, 4).Value = "?"
- ActiveCell.Offset(5, 5).Value = "?"
- ActiveCell.Offset(5, 6).Value = "?"
- ActiveCell.Offset(5, 9).Value = ""
- ActiveCell.Offset(6, 9).Value = ""
- ActiveCell.Offset(7, 9).Value = ""
- ActiveCell.Offset(8, 11).Value = TaskLink
- ActiveCell.Offset(5, 0).Select
- ActiveCell.Worksheet.Cells(ActiveCell.Row, 1).EntireRow.Select
- Selection.RowHeight = 23.8
- ActiveCell.Offset(0, 9).Select
- ' - Update total (Cell G4) to include new task -
- Call UpdateIndividualTotal
- ' Protect document
- ActiveSheet.Protect Password:="adminpw", DrawingObjects:=True, Contents:=True, Scenarios:=True
- End Sub
- Public Sub UpdateGroupTotal()
- '
- ' - Update total (Cell G4) to include new task -
- '
- Dim RunningTotal As String
- RunningTotal = "D15"
- Dim counter As Integer
- counter = 25
- Dim TaskCount As Integer
- TaskCount = Range("T208").Value
- For i = 2 To TaskCount
- RunningTotal = RunningTotal & "+D" & counter
- counter = counter + 10
- Next i
- Range("G4").Value = "=IFERROR(" & RunningTotal & ",""(Need Ratings)"")"
- End Sub
- Public Sub UpdateIndividualTotal()
- '
- ' - Update total (Cell G4) to include new task -
- '
- Dim RunningTotal As String
- RunningTotal = "D15"
- Dim counter As Integer
- counter = 25
- Dim TaskCount As Integer
- TaskCount = Range("S208").Value
- For i = 2 To TaskCount
- RunningTotal = RunningTotal & "+D" & counter
- counter = counter + 10
- Next i
- Range("G4").Value = "=IFERROR(" & RunningTotal & ",""(Need Ratings)"")"
- End Sub
- Sub RemoveGroupTask()
- '
- ' - Ask Rich to Delete Group Tasks
- '
- Result = MsgBox("Please talk to Rich if you want a Task removed." & vbCrLf & vbCrLf & "(I'll do it manually)", vbInformation, "Remove a Task")
- End Sub
- Sub SelectMenu()
- '
- ' Macro to go to the Main Menu
- '
- Sheets("Main Info").Select
- End Sub
- Sub SelectDocumentation()
- '
- ' Macro to go to the Documentation sheet
- '
- Sheets("Documentation").Select
- End Sub
- Sub SelectGroupTasks()
- '
- ' Macro to view the Group Tasks
- '
- Sheets("All Group Members").Select
- End Sub
- Sub SelectAndrew()
- '
- ' Macro to view Andrew's Tasks
- '
- Sheets("Andrew").Select
- End Sub
- Sub SelectOla()
- '
- ' Macro to view Ola's Tasks
- '
- Sheets("Ola").Select
- End Sub
- Sub SelectRich()
- '
- ' Macro to view Rich's Tasks
- '
- Sheets("Rich").Select
- End Sub
- Sub SelectZeeshan()
- '
- ' Macro to view Zeeshan's Tasks
- '
- Sheets("Zeeshan").Select
- End Sub
- Sub SelectGroup()
- '
- ' Macro to view Zeeshan's Tasks
- '
- Sheets("All Group Members").Select
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement