Consulting

Results 1 to 6 of 6

Thread: Solved: Look up a date range

  1. #1

    Solved: Look up a date range

    Greetings,
    I am trying to look up a date range (for example 04/01/06-04/30/06) and retrieve every name that falls within that range.

    Any help would be appreciated.

    Regards,
    Danny

  2. #2
    VBAX Regular Apps's Avatar
    Joined
    May 2006
    Posts
    38
    Location
    Might need a bit more info than you have given Danny - what 'Names' are you trying to retrieve? - can you include an example speadsheet for us to look at?

    Thanks,
    Apps

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Something like this perhaps. Uses a name range called "dates"

    [vba] Option Explicit
    Sub getdateinfo()
    Dim myrange As Range
    For Each myrange In Range("dates")
    If myrange.Value > "03/31/2006" And myrange.Value < "05/01/2006" Then
    "What you want to do here"
    End If
    Next
    End Sub [/vba]
    Peace of mind is found in some of the strangest places.

  4. #4
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location
    See if this helps you.

    Assuming your dates are in column A and your names are in column B.

    =INDEX($B$2:$B$100,SMALL(IF($A$2:$A$100>=$D$2,IF($A$2:$A$100<=$E$2,ROW($B$2 :$B$100)-ROW($B$2)+1)),ROW(A1)))

    Sample attachment below.

    Must be confirmed with:

    Control+Shift+Enter

  5. #5
    VBAX Regular
    Joined
    Mar 2005
    Location
    Helena, MT
    Posts
    90
    Location
    Pivot Table? Grouped by month?? days??

    lenze

  6. #6
    Thanks for all the help guys. It works now.

Posting Permissions

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