+ Reply to Thread
Results 1 to 8 of 8

Macro to search worbook with Key Inputs

  1. #1
    Registered User
    Join Date
    10-01-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Macro to search worbook with Key Inputs

    I want a Macro for the following case:
    In the “Search” Sheet I have entered the ‘roll no’ which I want to search in this excel workbook. I want to copy the entire row containing the ‘roll no’ in any data sheet to the “Result” Sheet. My workbook will contain many number data sheets(sheet2,sheet3,sheet4 here in this sample workbook). I have attached sample workbook here.
    Please let me know if you need any more information.

    Thanks
    Attached Files Attached Files
    Last edited by cooldebi; 10-26-2011 at 10:46 AM.

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

    Re: Macro to search worbook with Key Inputs

    Are there chances of having many more sheets other than sheet 2, 3 and 4?

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Macro to search worbook with Key Inputs

    Perhaps a macro like this could be of help?

    Please Login or Register  to view this content.
    Alf

  4. #4
    Registered User
    Join Date
    10-01-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Macro to search worbook with Key Inputs

    Yes, I will have many sheets not just sheet 2 ,3 and 4.

  5. #5
    Registered User
    Join Date
    10-01-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Macro to search worbook with Key Inputs

    Thanks Alf for posting the Macro.

    I tried but it is not working as per the requirement. Please see the "Result" sheet before running the Macro and after running the Macro. The Macro did not fulfill the requirement.

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to search worbook with Key Inputs

    Another option (using Find). In the attached file push green arrow.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Macro to search worbook with Key Inputs

    Humm, it seem that ActiveSheet.UsedRange does not work the same way in Excel 2007 as in Excel 2003.

    Try this macro and see if it works better

    Please Login or Register  to view this content.
    This macro assumes that the search sheet is the first and the result sheet is the last sheet.

    Alf
    Last edited by Alf; 10-27-2011 at 02:49 AM. Reason: added comments

  8. #8
    Registered User
    Join Date
    10-01-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Macro to search worbook with Key Inputs

    Very Good Job nilem
    It was crisp and a very efficient Macro.

    Thanks

+ 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