Results 1 to 2 of 2

Thread: Newbie question---vb/excel

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Posts
    2

    Newbie question---vb/excel

    Hey,

    I am a very inexperienced VBA programmer looking for some help.


    I have two columns of varying length. In the first, I would like to find the minimum non-null value. Once the min value is found I would like to return the corressponding value in the 2nd column to a different cell.


    Thanks,
    H Turner
    Last edited by heathturner; Mar 22nd, 2003 at 08:11 PM.

  2. #2
    New Member
    Join Date
    Mar 2003
    Posts
    6
    Hi

    Place this formula in any cell for a non VBA solution:

    =VLOOKUP(MIN(A:A),A:B,2,FALSE)

    Using VBA:

    With Application.WorksheetFunction
    Range("C1").Value = .VLookup(.Min(Columns("A")), Columns("A:B"), 2, False)
    End With


    The above assumes the minimum lookup value to be in column A and the offset(1column) returned value to be in column B

    Tom

Posting Permissions

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



Click Here to Expand Forum to Full Width