Private Sub Term()Application.ScreenUpdating = False
Application.Run "module5.destructure"
Dim msg, Style, Title
Dim oPrevSelection As Range
Dim rw As Long
rw = ActiveCell.Row
ActiveSheet.Unprotect "password"
Range(Cells(ActiveCell.Row, "C"), Cells(ActiveCell.Row, "D")).Select
Set oPrevSelection = Selection
Selection.Copy
Range("N1").PasteSpecial xlPasteValues
msg = ("Are you sure you want to get rid of " & Sheets("Employees").Range("N1").Value & " " & Sheets("Employees").Range("O1").Value & "?")
Style = vbYesNo + vbExclamation
Title = "Let's Think This Through..."
[COLOR=#ff0000]Response = MsgBox(msg, Style, Title, help, Ctxt)[/COLOR]
If Response = vbNo Then
MyString = "No"
Exit Sub
Else
MyString = "Yes"
End If
'need to find 'Master Availability' reference and clear
Sheets("Terminated").Visible = True
Sheets("Terminated").Select
ActiveSheet.Unprotect "password"
Sheets("Employees").Select
oPrevSelection.Select
'could dim values of current cells to establish the employee's name - this method still works though
Range(Cells(ActiveCell.Row, "C"), Cells(ActiveCell.Row, "L")).Select
Selection.Copy
Worksheets("Terminated").Select
lMaxRows = Cells(Rows.Count, "B").End(xlUp).Row
Range("B" & lMaxRows + 1).PasteSpecial xlPasteValues
Intersect(Columns("A"), Selection.EntireRow).Select
With Selection
.Value = Date
.NumberFormat = "mm/dd/yy"
End With
'go to column A of current row
'insert current date
Sheets("Employees").Select
oPrevSelection.Select
Range(Cells(ActiveCell.Row, "C"), Cells(ActiveCell.Row, "S")).Select
'Selection.Copy
With Selection
.ClearContents
End With
Sheets("Terminated").Select
Range(Cells(ActiveCell.Row, "C"), Cells(ActiveCell.Row, "B")).Select
Selection.Copy
Range("N1").PasteSpecial xlPasteValues
Sheets("Terminated").Select
ActiveSheet.Protect "password"
Sheets("Employees").Select
ActiveSheet.Protect "password", _
DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True
Sheets("Master Availability").Visible = True
Sheets("Master Availability").Range("E" & rw + 83).Resize(1, 15).Interior.Color = xlNone
Sheets("Master Availability").Range("E" & rw + 83).Resize(1, 15).ClearContents
Sheets("Employees").Select
Sheets("Master Availability").Visible = xlSheetVeryHidden
Range("E1").Activate
MsgBox (Sheets("Terminated").Range("N1").Value & " " & Sheets("Terminated").Range("O1").Value & " has been terminated."), vbInformation, "A Message from the Terminator..."
Application.Run "module5.structure"
Application.ScreenUpdating = True
End Sub