Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Criteria Searching

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


    Hi, I have a sheet that contains a number of words. What I want is to put a formula in that will look down the sheet and if a criteria is met, to return the column number. Can anyone help?

  2. #2
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    84,030
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    7 Thread(s)

    Default

    On 2002-04-23 07:21, buntykins wrote:

    Hi, I have a sheet that contains a number of words. What I want is to put a formula in that will look down the sheet and if a criteria is met, to return the column number. Can anyone help?
    Try to be a bit more specific.

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Midlands, UK
    Posts
    217
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Buntykins,

    I can't help but feel a little strange typing that & yuo're not my wife

    Anyway - try this :

    Sub Macro1()
    Range("a1:a10").Select
    myran = Selection.Find(What:="lewis", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
    MatchCase:=False).Row
    Range("d1").Value = myran
    End Sub

    This looks for "Lewis" in A1 to A10 & returns the row number in cell D1

    HTH,

    Iain


Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •