+ Reply to Thread
Results 1 to 8 of 8

search in sheet1 for particular string and copy in another sheet

  1. #1
    Registered User
    Join Date
    10-11-2019
    Location
    noida
    MS-Off Ver
    2013
    Posts
    5

    search in sheet1 for particular string and copy in another sheet

    Hi,

    i have to make a macro to search in sheet1 for particular string and copy in another sheet .

    the below code is not working .

    raw input is attached .kindly help .

    Please Login or Register  to view this content.
    .....................................
    Attached Files Attached Files
    Last edited by vikas04184; 10-14-2019 at 01:54 AM. Reason: resolved

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

    Re: earch in sheet1 for particular string and copy in another sheet

    I would entirely get rid of your macro, as Select+Activate is bad habit. Try this one:
    Please Login or Register  to view this content.
    Click the * to say thanks.

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

    Re: earch in sheet1 for particular string and copy in another sheet

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: earch in sheet1 for particular string and copy in another sheet

    Hi there Paul
    You used bottomA variable that is not declared nor initialized.
    Also you declared lastrow as Integer even though excel has many more rows that Integer variable type can hold.
    Also instead of
    Please Login or Register  to view this content.
    I thing that more appropriate would be
    Please Login or Register  to view this content.
    that way rng could contain the searched text but not only.

    Best wishes,
    Bogdan
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  5. #5
    Registered User
    Join Date
    10-11-2019
    Location
    noida
    MS-Off Ver
    2013
    Posts
    5

    Re: earch in sheet1 for particular string and copy in another sheet

    Hi Sir,

    i have tried with your suggestions . But still not successful . Please suggest .

    i have tried with below code.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by vikas04184; 10-12-2019 at 10:34 AM.

  6. #6
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: earch in sheet1 for particular string and copy in another sheet

    Hello Vikas,

    A slight addition to the code should help:-

    Please Login or Register  to view this content.
    The additional asterisk (in red font above) should be all that you need.

    Also, you have placed the code into the Sheet1 module. This is not an event code so it needs to be placed in a standard module and assigned to a button.

    I hope that this helps.

    Cheerio,
    vcoolio.
    Last edited by vcoolio; 10-12-2019 at 07:28 PM. Reason: Additional suggestion.

  7. #7
    Registered User
    Join Date
    10-11-2019
    Location
    noida
    MS-Off Ver
    2013
    Posts
    5

    Re: earch in sheet1 for particular string and copy in another sheet

    thanks now its working .

  8. #8
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: earch in sheet1 for particular string and copy in another sheet

    You're welcome Vikas. I'm glad that we were able to sort it out for you.
    Thanks for the rep.

    Cheerio,
    vcoolio.

+ 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. Replies: 6
    Last Post: 11-13-2015, 07:36 AM
  2. [SOLVED] cOPY PASTE FROM SHEET 2 TO SHEET1, last row
    By moonbreakker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2015, 02:23 PM
  3. Replies: 6
    Last Post: 05-12-2014, 02:35 PM
  4. Copy certain data from Sheet1 to Sheet 2 based on values in a column on Sheet1
    By theglitch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2013, 01:28 PM
  5. [SOLVED] Copy and Paste Entire Row from Sheet1->Sheet2 based on text string match in Sheet1 Row
    By dmlovic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-17-2012, 08:42 AM
  6. Copy and Paste from Sheet1 to Sheet 2
    By aalbertson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2011, 12:45 PM
  7. Excel 2007 : Copy Data From sheet 2 to sheet1
    By sonny cornelissen in forum Excel General
    Replies: 2
    Last Post: 09-06-2010, 11:44 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