Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Feb 2005
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Finding a Row in a Table - MyDGet (Excel 2003)

    Sometimes I'm asked to write code to find records in long tables with non-unique Keys. DGET with its access to a Criteria Table would be ideal except that it returns the value of a column and must be unique, ie only one row matches the criteria. Is there any clever and efficient way to get the row number instead? The ideal functionality would be something like

    MyDGet(database,field,criteria,startrow)

    where the first three arguments are as in DGET and the fourth indicates from where the search should start, thus allowing for multiple instances. I do most of my coding in the Macro 4 language and would very much appreciate assistance if VB is required.

    Geoffrey Howell

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Finding a Row in a Table - MyDGet (Excel 2003)

    Hi Geoffrey

    You could use the DMIN Function as my attached sample shows and use the the Use of row numbers
    Jerry

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Finding a Row in a Table - MyDGet (Excel 2003)

    But that doesn't help if there are multiple records that satisfy the criteria, does it?

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Finding a Row in a Table - MyDGet (Excel 2003)

    No it doesn't.....does it?
    Jerry

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Finding a Row in a Table - MyDGet (Excel 2003)

    I fear that's a rather tall order. Perhaps it would be better to use a database program such as Microsoft Access.

  6. #6
    Star Lounger
    Join Date
    Feb 2005
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Thank You

    Thanks to both of you. I think I'll probably try to code up a primitive equivalent based on a one row Criteria Table with simple conditions (probably equal) only allowed.

    regards

    Geoffrey Howell

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Thank You

    Good luck, that should be less difficult than trying to handle complex criteria. But I still think using the built-in features (Advanced Filter with the Copy To option) or moving to Microsoft Access would be better.

Posting Permissions

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