+ Reply to Thread
Results 1 to 2 of 2

Insert row in sheet 2 when condition met within row in sheet 1

  1. #1
    Registered User
    Join Date
    11-27-2016
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1

    Insert row in sheet 2 when condition met within row in sheet 1

    Looked at other posts, but didn't find much help. Not a VB power user.

    Need macro that will look within Sheet 1 first row at cell in specified column and then insert a row in sheet 2 if condition is met (ignore and go to next row if not). Contents of new sheet 2 row should contain only specified cells from sheet 1 row. Then go to next row and repeat. Finish when all rows that contain content are checked.

    Thanks in advance!

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,398

    Re: Insert row in sheet 2 when condition met within row in sheet 1

    Hopefully this does what you want:

    B1 in sheet 2 has a DropList from which you select the colour you are looking for.

    Code finds last row in sheet 2, and clears any data from row 2 to that last row.

    Then finds the last row in Sheet 1.

    Starting from row 2, code checks if Col A matches the colour you selected in Sheet 2.

    If it matches, it copies the data in Col B of that row into next free line of Sheet 2.

    If it doesn't match, it moves to the next row on sheet 1

    Repeats until it reaches the first blank row in SHeet 1.

    Please Login or Register  to view this content.
    Ochimus
    Attached Files Attached Files

+ 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. Auto copy specific data from sheet to antoher sheet under few condition
    By Shermaine2010 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-17-2014, 04:47 AM
  2. [SOLVED] VBA, Intercept 2 giving range from 2 sheet,If condition, intercepted copy to 3rd sheet
    By david gonzalez in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-20-2014, 09:32 PM
  3. Replies: 1
    Last Post: 05-11-2013, 02:58 AM
  4. Replies: 2
    Last Post: 05-01-2013, 12:26 PM
  5. If condition is met in sheet 2, take information from sheet 1 and post into sheet 3?
    By kyleplaysgolf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2012, 06:32 PM
  6. Replies: 5
    Last Post: 11-03-2012, 04:22 PM
  7. Copy Sheet / Create & Name New Sheet / Insert Before a Sheet / Paste Data
    By thinkspac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2012, 02:27 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