Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Help with filter code.

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter With VB Code Cam Excel Programming 1 August 10th 05 02:49 PM
filter with vb code wtpcomplab Excel Programming 16 March 15th 05 10:15 PM
vba code to filter rbekka33[_3_] Excel Programming 5 September 14th 04 09:22 AM
filter code help scrabtree[_2_] Excel Programming 2 August 1st 04 10:09 PM
Filter Code Ray Kanner[_2_] Excel Programming 4 April 29th 04 02:53 PM


All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"