Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Desperately Seeking FirstCell Find !

I am trying to search in the fist column of a range using the following
code. The problem is that the first item is never searched as it allways
starts 'AFTER' the top left hand cell, so I have a column of numbers 1 to
16 and I want to find 1, it starts at cell 2 and therfore never find the 1

Any Ideas ???

Public Function lookupRange(ByVal rangeName As Range, key As Variant, col As
Presets) As Variant

On Error Resume Next

Dim mr As Range

Set mr = rangeName.Find(what:=key, LookIn:=xlValues, lookat:=xlWhole,
SearchDirection:=xlNext, SearchOrder:=xlByColumns)
lookupRange = mr.Offset(0, col)


End Function


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Desperately Seeking FirstCell Find !

"LookIn:=xlFormulas" seems to work better

Rgds
J


On Oct 23, 1:13 pm, "Don Guillett" wrote:
why not just use MATCH to find the 1 and incorporate into an INDEX formula

--
Don Guillett
SalesAid Software
"Goofy" wrote in .. .



I am trying to search in the fist column of a range using the following
code. The problem is that the first item is never searched as it allways
starts 'AFTER' the top left hand cell, so I have a column of numbers 1 to
16 and I want to find 1, it starts at cell 2 and therfore never find the 1


Any Ideas ???


Public Function lookupRange(ByVal rangeName As Range, key As Variant, col
As Presets) As Variant


On Error Resume Next


Dim mr As Range


Set mr = rangeName.Find(what:=key, LookIn:=xlValues, lookat:=xlWhole,
SearchDirection:=xlNext, SearchOrder:=xlByColumns)
lookupRange = mr.Offset(0, col)


End Function- Hide quoted text -- Show quoted text -


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Desperately Seeking FirstCell Find !

But what I have is not a formula, its a simple value. What I have ended up
doing is specifying my range as the first column only, this way it wrapos
around to the first cell.

Thanks for your help anyway



"WhytheQ" wrote in message
oups.com...
"LookIn:=xlFormulas" seems to work better

Rgds
J


On Oct 23, 1:13 pm, "Don Guillett" wrote:
why not just use MATCH to find the 1 and incorporate into an INDEX
formula

--
Don Guillett
SalesAid Software
"Goofy" wrote in
.. .



I am trying to search in the fist column of a range using the following
code. The problem is that the first item is never searched as it allways
starts 'AFTER' the top left hand cell, so I have a column of numbers 1
to
16 and I want to find 1, it starts at cell 2 and therfore never find the
1


Any Ideas ???


Public Function lookupRange(ByVal rangeName As Range, key As Variant,
col
As Presets) As Variant


On Error Resume Next


Dim mr As Range


Set mr = rangeName.Find(what:=key, LookIn:=xlValues,
lookat:=xlWhole,
SearchDirection:=xlNext, SearchOrder:=xlByColumns)
lookupRange = mr.Offset(0, col)


End Function- Hide quoted text -- Show quoted text -




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
Desperately seeking ACTIVE.WORKBOOK function for XLM arcibald tuttle Excel Worksheet Functions 0 February 21st 11 01:25 PM
DESPERATELY NEED HELP newuser Excel Discussion (Misc queries) 3 November 2nd 07 04:02 PM
Desperately Seeking Offset Formula!! Jenny B. Excel Discussion (Misc queries) 3 July 27th 07 09:30 PM
Desperately need help!! Paula_p New Users to Excel 1 June 13th 06 10:26 PM
Desperately seeking some help! (Please) Peter Long Excel Programming 6 November 1st 04 08:07 PM


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