+ Reply to Thread
Results 1 to 6 of 6

Search string copy row to a different tab

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Search string copy row to a different tab

    Dear all,

    I need your help, and I will be very grateful if you could help me.

    I have a spreadsheet in which I would like to search for a string (column E) The string starts with 1.ABCXXXXX. I would like to search all values that start with 1.ABC and copy the entire row in a different tab. I tried to do it myself but the code is not working well. Could you please tell me what I am missing? Many thanks


    Please Login or Register  to view this content.

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Search string copy row to a different tab

    what exactly is "not working well"?....I can see one thing....I don't see where you are incrementing the variable j....looks like you will write over every row you copy....insert a j = j +1 inside the if statement....unless I'm missing something...HTH
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Search string copy row to a different tab

    Alternative to loop

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-07-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Search string copy row to a different tab

    AB33 this is perfect working the way I want it to work. Is it possible to check for two criteria, i.e. 1.ABC and 2.ABC for example as I need to extract data that starts with either prefix

    many thanks guys

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Search string copy row to a different tab

    Change this line
    Please Login or Register  to view this content.
    INTO

    Please Login or Register  to view this content.
    OR

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-07-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Search string copy row to a different tab

    AB33, Many thanks for that. Works perfectly for me

+ 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. Macro to search for a string and copy its row to another sheet
    By akynyemi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2013, 06:50 PM
  2. Replies: 2
    Last Post: 01-02-2013, 08:35 AM
  3. [SOLVED] Macro to search a string, then search above for another one and copy the rows between them
    By DarKDjinni in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-20-2012, 09:36 PM
  4. search a word in string then copy it to next cell
    By dontdont in forum Excel General
    Replies: 2
    Last Post: 11-23-2011, 04:07 AM
  5. search a string and copy rows thru vba
    By promoboy2 in forum Excel - New Users/Basics
    Replies: 15
    Last Post: 12-18-2010, 10:55 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