+ Reply to Thread
Results 1 to 3 of 3

how to select only specific rows corresponding to a specific value in a column

  1. #1
    Registered User
    Join Date
    01-27-2018
    Location
    milan
    MS-Off Ver
    2012
    Posts
    1

    how to select only specific rows corresponding to a specific value in a column

    hello everyone,
    i have this big problem. i would like to run a macro for this purpose: i have an excel sheet like this:

    COLUMN A COLUMN B COLUMNC
    2001018 C 30000
    2001018 P 28000
    2001018 P 30000
    20010218 C 25000
    20010218 P 25000
    20010218 C 27000

    i want to run a macro, that in correspondence to a data like 20010118 selects a row containing a C and a row containing a P but both of them must have the same value in column C. in this example for 20010118 i want to be selected only first row and third row.
    " to be selected" i mean to open a new worksheet with the selected rows.

    many thanks
    Last edited by valeria3; 01-27-2018 at 08:46 AM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: how to select only specific rows corresponding to a specific value in a column

    Try this macro:
    Please Login or Register  to view this content.
    This macro assumes that you have headers in row 1 of the sheet where your data is located and the data starts in row 2. Change the sheet names in the code to suit your needs.
    Last edited by Mumps1; 01-27-2018 at 12:37 PM.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: how to select only specific rows corresponding to a specific value in a column

    What if there are more "C" and "P" for a given (the same) value ?
    Are there to be only unique values or maybe multiple repetitions ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 09-13-2014, 11:14 AM
  2. How to select entire rows by specific column value?
    By gabrielemucho in forum Excel General
    Replies: 5
    Last Post: 09-09-2014, 08:06 AM
  3. [SOLVED] Copy rows with specific text in specific column into specific sheet
    By Valemaar in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 08-22-2014, 03:23 PM
  4. Replies: 1
    Last Post: 07-02-2014, 06:16 PM
  5. [SOLVED] Using a macro to select rows with a specific word in a column
    By ahilty in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-15-2013, 04:20 PM
  6. Replies: 0
    Last Post: 10-23-2012, 04:59 PM
  7. [SOLVED] select rows to print where there's data in specific column
    By ebarbieri in forum Excel General
    Replies: 1
    Last Post: 07-04-2006, 07:00 PM

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