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: 32
Default Find only in visible cells....

Hi all,
I made a function which returns the row number containing a search criteria.
The function is passed the search string (id) and the range to search in
(usually a column). This works fine - but I tried to modify it to only search
in visible cells if an autofilter had been applied - but it manages to find
hidden cells etc... any takers?
TIA

Function FindRecord(id As String, col As Range) As Long
Dim i As Long
Set col = col.SpecialCells(xlVisible)
col.Select
i = 0
On Error Resume Next
i = Selection.Find(what:=id, After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Row
FindRecord = i
End Function
 
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
find the number for visible row Nahc Excel Discussion (Misc queries) 2 May 16th 10 12:21 PM
find the number for visible row Nahc Excel Discussion (Misc queries) 1 May 15th 10 02:16 PM
Find first visible row m3s3lf[_16_] Excel Programming 5 August 6th 06 04:34 PM
How do I find and replace part of a hyperlink that isn't visible? Dede Excel Discussion (Misc queries) 1 April 28th 05 12:15 AM
Help: Copying Visible Cells only to Visible cells! Jay Jayakumar Excel Programming 0 July 9th 03 08:25 PM


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