Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    5

    Unanswered: Extracting Data from Excel

    Hello. I need some newbie help with a VB script in excel.

    I have one worksheet, called Dates, that contains several columns, but the two columns of importance are name and date:

    A B C D
    1 Name Dates Age Height
    2 John 12/13/2003 11 5.1
    3 Sue 12/14/2003 12 5.2
    4 Tom 12/15/2003 13 5.3

    Sorry, I think the formatting is messed up. There are 4 columns, Name, Dates, Age, and Height.

    The number of rows of data is variable, so I can have several names and dates or a few, but I can assume the maximum is 100.

    On another worksheet, called Summary, I need to extract the names and dates as long as they fall under a certain timeframe, for example, within 2 days.

    I want the data that is extracted to be placed in the cells A1:B10 of the Summary worksheet. I do not expect more than 10 results.

    I can write a mock-up code of what should happen... but I need help with visual basic notation...

    y=1
    x=2
    Do until x=102
    If Dates!B[x] is < Current Date + 2
    Summary!A[y] = Dates!A[x]
    Summary!B[y] = Dates!B[x]
    y = y +1
    End If
    x = x+1
    Loop

    If you can make sense of what I'm saying, your help would be appreciated. Thanks.
    Last edited by Yippeeee25; 12-12-03 at 20:34.

  2. #2
    Join Date
    Dec 2003
    Posts
    5

    Re: Extracting Data from Excel

    I just solved my own problem. Thanks anyway.

    Originally posted by Yippeeee25
    Hello. I need some newbie help with a VB script in excel.

    I have one worksheet, called Dates, that contains several columns, but the two columns of importance are name and date:

    A B C D
    1 Name Dates Age Height
    2 John 12/13/2003 11 5.1
    3 Sue 12/14/2003 12 5.2
    4 Tom 12/15/2003 13 5.3

    Sorry, I think the formatting is messed up. There are 4 columns, Name, Dates, Age, and Height.

    The number of rows of data is variable, so I can have several names and dates or a few, but I can assume the maximum is 100.

    On another worksheet, called Summary, I need to extract the names and dates as long as they fall under a certain timeframe, for example, within 2 days.

    I want the data that is extracted to be placed in the cells A1:B10 of the Summary worksheet. I do not expect more than 10 results.

    I can write a mock-up code of what should happen... but I need help with visual basic notation...

    y=1
    x=2
    Do until x=102
    If Dates!B[x] is < Current Date + 2
    Summary!A[y] = Dates!A[x]
    Summary!B[y] = Dates!B[x]
    y = y +1
    End If
    x = x+1
    Loop

    If you can make sense of what I'm saying, your help would be appreciated. Thanks.

  3. #3
    Join Date
    Oct 2003
    Posts
    1,091
    Glad you solved it.

    Just as a note: It might helps others if you would post how you solved it.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

Posting Permissions

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