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: 9
Default Can a custom Search function return a cell reference?

I am trying to create a custom function that will return a cell reference for
a search result. So far, I have this:

Function FindS(MySrch) As String

AC = Cells.Find(What:=MySrch, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Address

Ans = MsgBox("Search result (" & AC & ")", vbOKOnly, "RESULT")

End Function

I can capture the cell address in a message box but the active cell (where
the formula is) is empty. Ulitimately, I want to plug the results of 'FindS'
into another formula.

Everything I've tried has resulted in an error.
I feel like I'm close but I'm doing something fundamentally wrong.

Any ideas?

Thanks.

Mike
 
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
function to find value and return cell reference rcc Excel Discussion (Misc queries) 6 June 27th 12 02:55 AM
how do I create a cell reference from ADDRESS function return? Coachdenny Excel Worksheet Functions 3 December 2nd 08 04:22 AM
Search for data and return cell reference exoticdisease Excel Worksheet Functions 3 July 28th 08 02:16 PM
Which Function to Use? Search an Array, Return a Row Value [email protected] Excel Discussion (Misc queries) 1 August 24th 07 06:34 PM
auto filter doesn't return cells containing the custom search wor. annelidae Excel Worksheet Functions 2 August 24th 06 02:07 AM


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

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"