Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The initial code works fine. I have simply changed the criteria.
I played around with the following however, i have been unsuccessful. I need to change the following formula to reflect the new criteria. Old criteria: Filter everything in column A beginning with row 12 and place it in column B (a single instance list) starting with row 12. New criteria: Filter everything in column F beginning with row 17 and place it in column Q (a single instance list) starting with row 17. Any advice? Private Sub Worksheet_Change(ByVal Target As Range) Dim myRow As Long If Target.Cells.Count 1 Then Exit Sub If Target.Column < 1 Then Exit Sub Application.EnableEvents = False If Application.CountIf(Range("B:B"), Target.Value) = 0 Then rw = Range("B65536").End(xlUp)(2).Row If rw < 12 Then rw = 12 Cells(rw, 2).Value = Target.Value End If For myRow = Range("B65536").End(xlUp).Row To 12 Step -1 If IsError(Application.Match(Cells(myRow, 2).Value, Range("A:A"), False)) Then Cells(myRow, 2).ClearContents End If Next myRow Application.EnableEvents = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Filter With VB Code | Excel Programming | |||
filter with vb code | Excel Programming | |||
vba code to filter | Excel Programming | |||
filter code help | Excel Programming | |||
Filter Code | Excel Programming |