+ Reply to Thread
Results 1 to 9 of 9

Find matching text and copy all rows to new sheet

  1. #1
    Registered User
    Join Date
    04-22-2014
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    43

    Post Find matching text and copy all rows to new sheet

    Hello,

    I am looking for a macro that would Look in column C for the same text (text is not always grouped together) and copy all rows to a new sheet (or if possible a new workbook) and renaming it to match found name.

    Final result would be 3 new sheet added.

    Capture.PNG

    Thanks!
    Last edited by Gazou; 09-13-2019 at 08:38 AM.

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    2,100

    Re: Find matching text and copy all rows to new sheet

    here is a good example: https://social.msdn.microsoft.com/Fo...forum=exceldev
    Click the * to say thanks.

  3. #3
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,512

    Re: Find matching text and copy all rows to new sheet

    Should works:


    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010, 2019
    Posts
    2,262

    Re: Find matching text and copy all rows to new sheet

    Quote Originally Posted by KOKOSEK View Post
    Should works:


    Please Login or Register  to view this content.
    Untested, but if I am not mistaken, I think you can compact your code slightly by replacing the first two code lines highlighted in red above with this...
    Please Login or Register  to view this content.
    and the second two code lines highlighted in red above with this...
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-22-2014
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    43

    Re: Find matching text and copy all rows to new sheet

    Hello, your code works but would need manual attention if we add a new column of data.
    For example,

    Please Login or Register  to view this content.

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,512

    Re: Find matching text and copy all rows to new sheet

    Sure you can. I am not trying too much optimize code for transparency purposes.
    In the case when OP wants to tweak something is much easier to understand.

    @Gazou:
    Should works with additional column (not tested)
    Instead of:
    Please Login or Register  to view this content.
    put
    Please Login or Register  to view this content.
    Last edited by KOKOSEK; 09-12-2019 at 11:25 AM.

  7. #7
    Registered User
    Join Date
    04-22-2014
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    43

    Re: Find matching text and copy all rows to new sheet

    Great that worked! any clue if and how we could remove the Section so i dont have to add Specific values? so if someone decides to rename a cell it still works?

    Please Login or Register  to view this content.
    Thanks for you're help!
    Almost have it

  8. #8
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,512

    Re: Find matching text and copy all rows to new sheet

    What do you mean by 'rename a cell'?

  9. #9
    Registered User
    Join Date
    04-22-2014
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    43

    Re: Find matching text and copy all rows to new sheet

    Never mind it worked!

    Thank you!
    Eric

+ 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] Macro to filter sheet 1 - 10 with a unique text value and copy all the rows in sheet 11
    By Shayk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-18-2017, 07:13 PM
  2. Macro to copy text from sheet 1 to changing cell in sheet 2
    By Difflam88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-18-2015, 03:12 AM
  3. [SOLVED] Search a column within 1 sheet for text values if true copy that row to sheet 2
    By m77wls in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-19-2015, 05:32 PM
  4. Using macro to locate certain text, then copy the cell below text into another sheet
    By BobertSama in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2013, 01:32 PM
  5. Replies: 6
    Last Post: 02-03-2012, 05:44 AM
  6. One Entry - text in one cloumn, number in another
    By kbab in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-19-2007, 08:17 PM
  7. loan calculator cells, P&I formulas do not copy to second cloumn
    By Mr. C in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-05-2005, 12:06 PM

Tags for this Thread

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