This question might look silly but I have never tried this before.
How do you put these different codes to work as a single module? I added a button in my worksheet hoping that it would process all the different requests once.
Worsksheet name: WC
First: ReplaceVlookupValues() is made to replace the vlookups by values so the macro can pick it up.
Second: Sub DeleteStatus() is made to delete the selected words in column H.
Third: DeleteEmployeeCriteria() is made to delete the selected words in column CE.
Fourth: DeleteOkIssueCriteria() is made to delete the selected words in column CP.
Sub ReplaceVlookupValues()
'Copy A Range of Data
Worksheets("WC").Range("A3:CP35000").Copy
'PasteSpecial Values Only
Worksheets("WC").Range("A3").PasteSpecial Paste:=xlPasteValues
'Clear Clipboard (removes "marching ants" around the original data set)
Application.CutCopyMode = False
End Sub
Sub DeleteStatus()
Application.ScreenUpdating = False
Dim toDelete As Variant
' set the words to delete
toDelete = Array("Closed", "Resigned", "TBC")
Dim colD As Range
Set col = Sheet1.Range("H3:H" & Sheet1.Range("H" & Rows.Count).End(xlUp).Row)
With col
.AutoFilter Field:=1, Criteria1:=toDelete, Operator:=xlFilterValues
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
Sheet1.AutoFilterMode = False
End Sub
Sub DeleteEmployeeCriteria()
Application.ScreenUpdating = False
Dim toDelete As Variant
' set the words to delete
toDelete = Array("0NotEmployee", "1NotEmployee")
Dim colD As Range
Set col = Sheet1.Range("CE3:CE" & Sheet1.Range("CE" & Rows.Count).End(xlUp).Row)
With col
.AutoFilter Field:=1, Criteria1:=toDelete, Operator:=xlFilterValues
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
Sheet1.AutoFilterMode = False
End Sub
Sub DeleteOkIssueCriteria()
Application.ScreenUpdating = False
Dim toDelete As Variant
' set the words to delete
toDelete = Array("OK")
Dim colD As Range
Set col = Sheet1.Range("CP3:CP" & Sheet1.Range("CP" & Rows.Count).End(xlUp).Row)
With col
.AutoFilter Field:=1, Criteria1:=toDelete, Operator:=xlFilterValues
.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
Sheet1.AutoFilterMode = False
End Sub