+ Reply to Thread
Results 1 to 4 of 4

Copy rows containing specific string into a new sheet

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    Maine, USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Copy rows containing specific string into a new sheet

    Hello, it's my first time posting here.

    I have a sheet with data that contains one of 10 names in column B. I would like to make a macro that would copy the entire row containing a particular name, then paste it into a new sheet.

    Essentially, I would like it to imitate the action of filtering by name and copying the results onto a new sheet.

    I've seen a few similar situations on here, but I can't seem to modify the codes to fit my particular data. I could use some help.
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy rows containing specific string into a new sheet

    Try this code - do let me know if you also want to clear the contents of the main sheet once the row is copied -
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    05-13-2013
    Location
    Maine, USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Copy rows containing specific string into a new sheet

    Thanks so much for your response, this works perfectly! Got an error the first time, but it was my fault.
    Attached Images Attached Images
    Last edited by Ticklekisses; 05-14-2013 at 10:53 AM. Reason: Ran it incorrectly the first time.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy rows containing specific string into a new sheet

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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