Autofilter and offset issue

izzy117

New Member
Joined
Feb 13, 2008
Messages
41
I am trying to filter data in column A. If I find a match I plan on selecting that match and if no match I want to offset to a blank cell below the list. The list contains no duplicates and never will/should.

Rich (BB code):
'Fruitforsale = Pears
 
Range("A5").select
Selection.AutoFilter Field:=1, Criteria1:=(Range("Fruitforsale"))
Range("A65536").End(xlUp).Select
If ActiveCell.Value <> Range("Fruitforsale").Value Then
ActiveCell.Offset(1).Select
End If
 
'Example
 
A5 Header
apples
oranges
grapes
bananas
 
A10 should be selected but it actually selects A6.
Please advise?



Totaly confusing when I see evidence that this macro worked fine two days ago with no changes made (psw protected). As proof to me the rows with oranges, grapes and bananas only exist because this macro did function correctly in the creation of those rows.
I do not use a Find macro because I have found it has issues giving me an exact match between "pear" and "pears" and is case sensitive.

Note the data I am filtering is 1,600 rows long, not sure if that affects the autofilter function.
Running Office/Excel 2000, Windows 2000. All items updated Feb 27th.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Find will work just fine as long as you specify Lookat:=xlWhole and MatchCase:=False
 
Upvote 0
Find((Range("Fruitforsale").Value), LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False)

Much better, more reliable. TYVM rorya :)
 
Upvote 0

Forum statistics

Threads
1,203,686
Messages
6,056,736
Members
444,887
Latest member
cvcc_wt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top