Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Code Reference Issue

In need of help!

Does anyone know how I could change the code below to reference to B13
in stead of B2..?
It filters info in column A to Column B which works fine but I need it
to start the filtered list at B13.

(I've tried everything!)



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
Range("B65536").End(xlUp)(2).Value = Target.Value
End If


For myRow = Range("B65536").End(xlUp).Row To 2 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Code Reference Issue

For myRow = Range("B65536").End(xlUp).Row To 2 Step -1

to

For myRow = Range("B65536").End(xlUp).Row To 13 Step -1

--
Regards,
Tom Ogilvy



"J.W. Aldridge" wrote:

In need of help!

Does anyone know how I could change the code below to reference to B13
in stead of B2..?
It filters info in column A to Column B which works fine but I need it
to start the filtered list at B13.

(I've tried everything!)



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
Range("B65536").End(xlUp)(2).Value = Target.Value
End If


For myRow = Range("B65536").End(xlUp).Row To 2 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Code Reference Issue

I don't see any code here referencing a filter. Your filter may have been
manually setup through the Excel menu items, Data-Filter.

"J.W. Aldridge" wrote in message
oups.com...
In need of help!

Does anyone know how I could change the code below to reference to B13
in stead of B2..?
It filters info in column A to Column B which works fine but I need it
to start the filtered list at B13.

(I've tried everything!)



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
Range("B65536").End(xlUp)(2).Value = Target.Value
End If


For myRow = Range("B65536").End(xlUp).Row To 2 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Code Reference Issue

Oops! I missed that. See Tom's respons.
Thanks.

"PCLIVE" wrote in message
...
I don't see any code here referencing a filter. Your filter may have been
manually setup through the Excel menu items, Data-Filter.

"J.W. Aldridge" wrote in message
oups.com...
In need of help!

Does anyone know how I could change the code below to reference to B13
in stead of B2..?
It filters info in column A to Column B which works fine but I need it
to start the filtered list at B13.

(I've tried everything!)



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
Range("B65536").End(xlUp)(2).Value = Target.Value
End If


For myRow = Range("B65536").End(xlUp).Row To 2 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





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Code Reference Issue


The filtered list is still showing up starting with cell B2.

Any clues?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Code Reference Issue

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 < 13 then rw = 13
Cells(rw,2).Value = Target.Value
End If


For myRow = Range("B65536").End(xlUp).Row To 13 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

--
Regards,
Tom Ogilvy

"J.W. Aldridge" wrote:


The filtered list is still showing up starting with cell B2.

Any clues?


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
VLOOKUP reference issue Mike Excel Discussion (Misc queries) 4 August 6th 09 07:42 PM
Cell Reference Issue Craig Excel Worksheet Functions 2 April 28th 09 05:22 AM
Cell reference Issue Jerry Foley Excel Worksheet Functions 2 June 19th 07 01:23 PM
Cell Reference Issue CraigM Setting up and Configuration of Excel 3 November 12th 05 02:58 PM
Reference Issue ACFalcon Excel Programming 1 September 9th 05 03:42 PM


All times are GMT +1. The time now is 03:34 PM.

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

About Us

"It's about Microsoft Excel"