+ Reply to Thread
Results 1 to 10 of 10

Pulling data out of a table

  1. #1
    Registered User
    Join Date
    07-16-2008
    Location
    USA
    Posts
    10

    Pulling data out of a table

    I have a 4 columned table with 10000 rows

    Entry # Correlation Index1 Index2
    1
    2
    .
    .
    10000


    I want to be able to create tables out of this where I can pull all line items with correlation > 0.8 or <0.1 or <0.3 etc.


    I think a macro will have to be written for this.

    I would really appreciate if anyone could help me with this problem.

    Thanks.

  2. #2
    Registered User
    Join Date
    07-16-2008
    Location
    USA
    Posts
    10

    Pulling data out of a table

    I have a 4 columned table with 10000 rows

    Entry # Correlation Index1 Index2
    1
    2
    .
    .
    10000


    I want to be able to create tables out of this where I can pull all line items with correlation > 0.8 or <0.1 or <0.3 etc.


    I think a macro will have to be written for this.

    I would really appreciate if anyone could help me with this problem.

    Thanks.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Just add a helper column that tests the criteria you want, and then sort or Advanced Filter.

  4. #4
    Registered User
    Join Date
    08-10-2007
    Posts
    51

    Pulling Line Items

    I'm not sure exactly how many tables you are looking for but try this piece of code I just built. Note, I created a sheet called "Main" with 4 columns and this code looks at the second column where the second column contains the "Correlation" term. Final output is 3 sheets with the 3 conditions you requested for.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    piyushdabomb,

    In this declaration,
    Please Login or Register  to view this content.
    ... all but the first variable is declared as a Variant.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Threads merged.

    baroda11, please read our Forum Rules before starting your next thread. Posting the same question in two forums will see both deleted.

  7. #7
    Forum Contributor snasui's Avatar
    Join Date
    07-15-2007
    Location
    Songkhla, Thailand
    MS-Off Ver
    2010, 365
    Posts
    167
    One way to use Advanced Filter see attached file.
    Attached Images Attached Images

  8. #8
    Registered User
    Join Date
    07-16-2008
    Location
    USA
    Posts
    10
    Thank you'll for the valuable pointers. I think both approaches work well.

    Cheers,

    Baroda11

  9. #9
    Registered User
    Join Date
    08-10-2007
    Posts
    51
    shg,

    Thanks. I just checked the locals browser and you're right. Thank you for the tip. How can I save space and keep all variables a range?

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Quote Originally Posted by shg
    ... all but the first variable is declared as a Variant.
    Sorry, I meant "all but the last" (I think you figured that).
    How can I save space and keep all variables a range?
    You can't. You can do,
    Please Login or Register  to view this content.
    Or do what I do:
    Please Login or Register  to view this content.
    ... with every variable on its own line, and an end-of-line comment that describes how it's used.

    Good code isn't about saving space, it's about code that you can read, understand, and reuse two years later.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1