+ Reply to Thread
Results 1 to 8 of 8

Search query help required

  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Search query help required

    =PROBLEM SOLVED, thank you DonkeyOte=

    Hi there,

    I need a macro that can search through all of my worksheets bar the first one looking for the string given by the value of cell (sheet1,A,2). If it finds the string in sheet2 it should fill cell (sheet1,B,2) with the string "True". If found in sheet3, it should fill cell (sheet1,C,2) with "True", etc.

    Once it has done this, it should be able to loop and do the same for the string given in (sheet1,A,3), etc.

    Looking back on what I've just written I'm not sure how well I've explained myself, so I'll try to convey what I want done in pseudocode:

    Please Login or Register  to view this content.
    Hopefully that'll explain what I want done and hopefully one of you macro-geniuses will be able to help me!

    Cheers!
    Last edited by Jimple Fish; 06-30-2009 at 08:38 AM. Reason: Problem solved - thanks to DonkeyOte

  2. #2
    Registered User
    Join Date
    07-03-2008
    Location
    Hyderabad, India
    MS-Off Ver
    2003 and 2007
    Posts
    58

    Thumbs up Re: Search query help required

    Hi Try this,

    Please Login or Register  to view this content.
    Regards,
    Salim
    Last edited by salimudheen; 06-26-2009 at 10:01 AM.
    Salim

  3. #3
    Registered User
    Join Date
    06-26-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Search query help required

    Hi Salim, thanks for your prompt reply!

    Tried using your code and I got an overflow error on the line:

    Please Login or Register  to view this content.
    Any idea how to solve this?

    Thanks for helping!

  4. #4
    Registered User
    Join Date
    07-03-2008
    Location
    Hyderabad, India
    MS-Off Ver
    2003 and 2007
    Posts
    58

    Thumbs up Re: Search query help required

    Hi,

    I make some changes in code.

    Below is the code,

    Please Login or Register  to view this content.
    Regards,
    Salim

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Search query help required

    Here is another variant on the same theme....

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-26-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Search query help required

    DonkeyOte, your code appears to be almost perfect - the only problem is that when it fills the relevant cells in with "TRUE", it only does so in the second column. I need it to fill in the cell where the column matches up to the sheet it was found in: EG, if it found the text in sheet3, it says "TRUE" in column 3. If found in sheet2 and sheet4, it says "TRUE" in columns 2 and 4.

    Thanks for this. (If anyone else knows how to help, please feel free to chip in!)

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Search query help required

    So is the sheet containing the search criteria the left most sheet in the workbook ?

  8. #8
    Registered User
    Join Date
    06-26-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Search query help required

    I worked it out - thank you so much for your help DonkeyOte! Couldn't have done this without you.

+ 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