LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Autofilter method of range class failed

I have a worksheet that filtered on a cell that utilized the
validation tool and it worked fine with this code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
If Target.Address = "$B$2" Then
Set r = Me.AutoFilter.Range
r.AutoFilter field:=9, Criteria1:=Range("b2").Value
End If
End Sub

Now I added a combo box called ParentName and linked the cell to the
combo box. the issue I have is the code does not recognize a change in
cell B2. So I changed the code again and I get the range class failed
error.

Private Sub ParentName_Change()
Dim r As Range
Set r = Me.AutoFilter.Range
r.AutoFilter field:=9, Criteria1:=ParentName.Value
End Sub

Can someone see where I went wrong?
 
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
PasteSpecial method of Range class failed Frank Hayes Excel Programming 6 October 3rd 07 01:34 PM
AutoFilter method of Range class failed maboli Excel Programming 2 November 17th 06 02:19 PM
AutoFilter method of Range class failed blopreste3180 Excel Programming 1 January 17th 06 10:40 PM
Autofilter method of range class failed Terry K Excel Programming 5 October 18th 05 03:09 AM
AutoFilter method of Range Class Failed Randy Reese Excel Programming 3 April 3rd 04 04:34 AM


All times are GMT +1. The time now is 06:55 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"