Sub FilterAboveAverage()
Dim ws As Worksheet
Dim rng As Range
Dim cell As Range
Dim averageRate As Double
Dim threshold As Double
' Set the worksheet and range
Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to the name of your sheet
Set rng = ws.Range("A1:A" & ws.Cells(ws.Rows.Count, "A").End(xlUp).Row) ' Assumes data is in column A
' Calculate the average rate
averageRate = Application.WorksheetFunction.Average(rng.Value)
' Set the threshold (40% above average)
threshold = averageRate * 1.4
' Clear any previous filters
ws.AutoFilterMode = False
' Apply a filter for values above the threshold
rng.AutoFilter Field:=1, Criteria1:=">" & threshold
' Copy the visible cells to a new sheet (adjust destination as needed)
rng.SpecialCells(xlCellTypeVisible).Copy Destination:=ws.Range("B1") ' Copies to column B, adjust as needed
' Clear the filter
ws.AutoFilterMode = False
End Sub