+ Reply to Thread
Results 1 to 8 of 8

Find first and last row based on two columns

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    97

    Find first and last row based on two columns

    Hey guys,

    Say I have two columns, A and B.

    Column A is filled with either Yes or No down multiple rows.

    Column B is filled either 1, 2, or 3 down multiple rows.

    I'm looking for VBA code that would determine the first and last rows that contain No in Column A and 2 in Column B.

    Thanks!

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Find first and last row based on two columns

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Registered User
    Join Date
    06-19-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    97

    Re: Find first and last row based on two columns

    Works perfect, thanks a ton!

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Find first and last row based on two columns

    You're welcome

  5. #5
    Registered User
    Join Date
    06-19-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    97

    Re: Find first and last row based on two columns

    Hey Mick,

    Dumb follow-up question:

    What if the two columns I'm referencing are on a different sheet than where my main code is.

    I'm coding from a button on Sheet10, but referencing columns on Sheet1.

    Here's where the code fails now:

    Please Login or Register  to view this content.
    Last edited by mattmc419; 02-22-2018 at 12:23 PM.

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Find first and last row based on two columns

    Try:-
    Please Login or Register  to view this content.
    Nb:- Notice dots:- .

  7. #7
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,257

    Re: Find first and last row based on two columns

    Please Login or Register  to view this content.
    Last edited by daboho; 02-22-2018 at 01:15 PM.
    "ThankyouFor Attention * And Your Help!!"

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,519

    Re: Find first and last row based on two columns

    Quote Originally Posted by mattmc419 View Post
    I'm looking for VBA code that would determine the first and last rows that contain No in Column A and 2 in Column B.
    Please Login or Register  to view this content.

+ 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] Find duplicates based on certain columns
    By Hodor84 in forum Excel General
    Replies: 3
    Last Post: 01-06-2017, 11:00 AM
  2. Need to find a specific row based on matching 3 columns
    By Telperion in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2013, 06:53 AM
  3. Find Best Combination based on two columns
    By bountyHunter03 in forum Excel General
    Replies: 6
    Last Post: 05-01-2012, 02:01 AM
  4. Replies: 1
    Last Post: 02-13-2012, 08:08 PM
  5. Need to find duplicates based on criteria in two columns
    By yellowsun60 in forum Excel General
    Replies: 2
    Last Post: 01-11-2012, 07:25 PM
  6. Find a value based on criteria in columns and rows
    By Weasel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-05-2008, 06:18 PM
  7. Find and replace based on columns .. Help!
    By khaos in forum Excel General
    Replies: 9
    Last Post: 12-28-2006, 10:21 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