+ Reply to Thread
Results 1 to 5 of 5

Looping through data and finding cells that meet criteria

  1. #1
    Registered User
    Join Date
    09-12-2013
    Location
    NW MN
    MS-Off Ver
    Excel 2010
    Posts
    17

    Looping through data and finding cells that meet criteria

    I have a worksheet that I wish to separate into separate worksheets by a persons name. I want to copy a row if it meets a certian criteria, D<>"" and paste it into the new worksheet. I can sort Column C wish will contain the persons name, and for every change in column C it will pull the next persons name and create a worksheet with that name and then loop through and if there is no change in column C and if column D <>"" then I want to copy that row into the worksheet. I kind of see what I want, and know what I want, I am just not familiar enough with VBA to understand how to GET what I want. I know there will be a loop and I feel like the more seasoned excellers out there will be able to get this.

    Thanks in advance!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Looping through data and finding cells that meet criteria

    pbarry,

    Welcome to the forum!
    Have a look here: http://www.excelforum.com/tips-and-t...-criteria.html
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    09-12-2013
    Location
    NW MN
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Looping through data and finding cells that meet criteria

    Tiger, thanks for the welcome.

    I had a tough time going through that and picking out what I would need and what I wouldn't need. Is there a way possible that you could look at this file and tell me what I would need to do to make sheet1 turn into the tabs, by naming them and pulling the information where if it's blank skip and if it's populated, copy that row into the tab named the same as the offset of (0,-1). I think I may have an idea on how to do it with a workaround way, but i'd like an efficient way that will run the calculations clean and quick. This attachment shows the output, but in the code I will include to delete sheet1 but left it here so you can see a starting point. I'm not at that level yet, but hopefully soon after seeing the code and putting the pieces together.

    Test.xlsx

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Looping through data and finding cells that meet criteria

    Here's the code slightly customized. Note that I set the strCriteriaCol to "C" and I also added a filter for non blanks in column D:
    Please Login or Register  to view this content.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,701

    Re: Looping through data and finding cells that meet criteria

    Thread moved to appropriate forum.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Averaging data if cells in range meet criteria
    By gobbledok in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-24-2013, 02:28 AM
  2. move row data to a new tab when cells meet specific criteria
    By brian807 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-10-2012, 10:18 AM
  3. Finding how many cells meet a criteria
    By stujoed in forum Excel General
    Replies: 3
    Last Post: 06-30-2011, 04:55 PM
  4. Excel 2007 : Finding the first value to meet my criteria
    By bmercer54 in forum Excel General
    Replies: 5
    Last Post: 12-09-2009, 12:28 PM
  5. Delete data in cells that don't meet criteria
    By SITCFanTN in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-10-2006, 04:10 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