Sub CDW()
'
' CDW Macro
' Macro recorded 6/1/2011 by Cody D Works
'
'
Range("A:E,G:G,I:I,K:K,M:M,O:O").Select
Range("O1").Activate
ActiveWindow.SmallScroll ToRight:=14
Range("A:E,G:G,I:I,K:K,M:M,O:O,Q:Q,S:S,U:U,W:W,Y:Y,AA:AA").Select
Range("AA1").Activate
Selection.Delete Shift:=xlToLeft
Dim rngs As Range
Set rngs = Range(Range("A2"), Range("A65536").End(xlUp))
rngs.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Dim rng As Range, cell As Range
Dim delRng As Range
Dim dateCol As String
Dim cutoffDate As Date
Dim TheString As String
TheString = Application.InputBox("Enter A Date")
If IsDate(TheString) Then
cutoffDate = DateValue(TheString)
Else
MsgBox "Invalid date"
End If
dateCol = "E"
Set rng = Range(Range(dateCol & "2"), Range(dateCol & "65536").End(xlUp))
For Each cell In rng
If IsDate(cell.Value) And cell.Value > cutoffDate Then
If delRng Is Nothing Then
Set delRng = cell
Else
Set delRng = Union(delRng, cell)
End If
End If
Next cell
If Not delRng Is Nothing Then delRng.EntireRow.Delete
Selection.AutoFilter
Range("A1:L127").Sort Key1:=Range("E1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Columns("H:H").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:="0"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.Underline = xlUnderlineStyleSingle
End With
Selection.FormatConditions(1).Interior.ColorIndex = 6
End Sub