+ Reply to Thread
Results 1 to 3 of 3

Get Row number of matches within a column

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Get Row number of matches within a column

    Hello,
    I have a column which contains a long list of Products; The products might be listed multiple times in the column, like:
    Product 1
    Product 2
    Product 2
    Product 5
    Product 5
    Product 2
    Product 1
    Product 3
    Product 6
    Product 3
    I need a macro which looks up say, the” Product 2” and returns a list of the Row numbers where “Product 2“ is listed.
    (in this case, would look like: 2,3,6)
    Could you please advise.
    Thanks

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Get Row number of matches within a column

    Assumes Data is in Column A.

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Get Row number of matches within a column

    which contains a long list of Products
    In that case I would read column values into memory and work from there.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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. [SOLVED] INDEX on a cell in Column H if field $A4 matches Column D *OR* Matches Column E?
    By StevenCranford in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-09-2017, 09:05 PM
  2. Number of unique matches in two ranges within the same column
    By slmayobb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-07-2017, 03:26 AM
  3. [SOLVED] If number in Column A matches number in column B - Copy B cell and adjacent cells ?
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-16-2014, 12:30 PM
  4. [SOLVED] Delete rows if column A matches number and meets condition in another column
    By stokiejames09 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-05-2014, 05:03 PM
  5. [SOLVED] Trying to find a Column Number that matches a string
    By ChesterTate in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2012, 08:49 PM
  6. Match column between two sheets and copy row format once column number matches
    By kapil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2010, 07:54 AM
  7. if any # in column A matches any number in column B......
    By kennydavis in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-16-2009, 02:54 AM

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