+ Reply to Thread
Results 1 to 4 of 4

Search, copy and paste macro.

  1. #1
    Registered User
    Join Date
    08-08-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Search, copy and paste macro.

    Hi, I'm rather new to the whole making macros for excel thing and have got rather stuck on trying to create a macro.

    What I am trying to do is create a macro which will search for a word or number which is entered into a dialog box, with the entered word or number I would like for multiple worksheets to be searched and for each instance that the searched item appears the row it is present in to be copied and then finally pasted to a sheet which I will define as "Search" for example.

    I hope what I am trying to do comes across clearly enough.

    Any help or advice on what I can do will be much appreciated.

    Thanks.
    Last edited by Shin278; 08-08-2011 at 09:38 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Search, copy and paste macro.

    Assuming:

    1) You will place a search button on your sheet called "Search" to run this macro
    2) You want the search sheet to only list the rows of the most recent search
    3) You want ALL sheet searched except the "Search" sheet
    4) You want ALL cells searched on each sheet
    5) You want to see the entire row(s)
    6) That sometimes the search string is a "whole cell" value and other times it is a "partial cell" value

    Try this:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 08-08-2011 at 08:51 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-08-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Talking Re: Search, copy and paste macro.

    Thank you very much JBeaucaire, the solution you provided worked great for what I needed to do. Sorry about the poorly articulated explanation of what I needed in the original post.

    Thanks.

  4. #4
    Registered User
    Join Date
    01-27-2008
    Posts
    11

    Re: Search, copy and paste macro.

    JBeaucaire, I was looking for a similar solution and your code was very helpful. Since I am novice in VBA, as well, could you please help to modify it slightly to meet my needs. In the nutshell, that is what I am looking for:
    ~ Once I enter the search criterion and hit the button, I would like also to search through multiple worksheets, but only at the specific column on each worksheet, for example, column C.
    ~ In my case, the value I am searching for will be a unique one, so as soon as I found it, I would like to go to that particular worksheet where this value was found. For example, I started from my "Search" worksheet and searched through dozens of worksheets, once the value is found, it is displayed on that particular worksheet "as is" and the execution of code ends.

    I would appreciate your help. I am running Excel 2007.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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