Hello all,

Currently I have two macros where two columns are of importance: one column has names, the other has numbers (both columns have text headers).

The code for the first macro is this:
Sub FilterDoubles()

selection.AutoFilter

    ActiveSheet.Range("$A$1:$CI$14125").AutoFilter Field:=17, Criteria1:=Array( _
        "name1", "name2", "name3", "name4", _
        "name5", "name6", "name7", "name8", _
        "name9", "name10", "name11", "name12", _
        "name13", "name14"), Operator:=xlFilterValues


End Sub
So this one works the way I want it to (I had to edit the real names before posting here). It filters my list by the names that I've given it. After it filters my list, I manually select the second column with numbers and use my second macro.

The second macro is this:

Sub DivideBy2()

For Each cell In selection.Cells
    If cell.Value > 0 Then
        cell.Value = cell.Value / 2
    End If
Next

End Sub
The problem is that the second macro seems to be applied to ALL cells in the range from the first cell I selected to the last cell I selected (including all cells that were supposed to have been filtered out), and not just the ones that I've selected/filtered for. Any ideas?