hi all,
I have the code below which is doing all I need it to do, except I would like to add a line that deletes all rows where the cell value in column "F" is a number:
Also, if anyone has any suggestions to meke it more efficiant, please feel free to make them, but the main thing is I can delete all rows if the value in column "F" is a number.
Idea Being, it:
- Deletes all rows where value in column F is blank.
- then Deletes all rows where value in column "F" is numeric
- Then deleted all rows where value in column "F" is any value specified in Column A is sheet 2.
Sub RemoveExceptions()
Range("F:F").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Dim StartingScreenUpdateValue As Boolean
Dim StartingEventsValue As Boolean
Dim StartingCalculations As XlCalculation
With Application
StartingScreenUpdateValue = .ScreenUpdating
StartingEventsValue = .EnableEvents
StartingCalculations = .Calculation
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With
Dim varTestValues As Variant
varTestValues = Sheets(2).Range("A1:A90")
Rows(1).Insert
[A1].FormulaR1C1 = "TempHeader1"
[A1].AutoFill Destination:=Range("A1:M1"), Type:=xlFillDefault
Range("F1").AutoFilter Field:=6, Criteria1:=Application.Transpose(varTestValues), Operator:=xlFilterValues
Range("F2", Range("F" & Rows.Count).End(xlUp)) _
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
ActiveSheet.AutoFilterMode = False
Rows(1).Delete
With Application
.ScreenUpdating = StartingScreenUpdateValue
.EnableEvents = StartingEventsValue
.Calculation = StartingCalculations
End With
End Sub
Many thanks in advance!
Bookmarks