+ Reply to Thread
Results 1 to 20 of 20

Restricting search field

  1. #1
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Restricting search field

    Hi All,
    How can I restrict the search field, instead of following statement:

    HTML Code: 
    How can I say search only in 10 columns to right. Although I have data in more than 10 columns.

    Thanks for help
    Sarah

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Restricting search field

    Sarah

    10 columns to the right of what?
    If posting code please use code tags, see here.

  3. #3
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Restricting search field

    Hi sarah,
    If I understand correctly, if you want to look at the 10th column to the right of the active cell, try this :

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    Norie,
    It would be of sheet1 from cell a1
    Thanks
    Sarah

  5. #5
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    Hi GC,
    I like to look in 10 coulmns starting from a1
    Thanks
    Sarah

  6. #6
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Restricting search field

    Then you must use RESIZE :

    Please Login or Register  to view this content.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Restricting search field

    Perhaps.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    Norie and GC,

    I have this code taken from this site and changed a bit to suite my workbook.
    My intent is to make this code work faster, it takes long time to put the searched entry in sheet2.
    Please look into it if you can make it faster. I thought by restricting the search fields it might be faster, but it is not.

    HTML Code: 

  9. #9
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Restricting search field

    Can you share your file (or part of it) with example of expected results ?

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Restricting search field

    I'm pretty sure the line of code you posted previously isn't slowing things down, all it does is find the last column of data in row 1.

    What exactly is the code meant to do?

    Can you upload an example workbook?

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

  11. #11
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    All it does is find the id and copy the whole row in sheet2.
    then in sheet2 I have to edit and put it back through the 'putback' code.
    I cannot put the data online.
    Sarah

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Restricting search field

    Sarah

    Have you tried using a filter to find all the rows with the ID and then copying them to Sheet2?

  13. #13
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    Norie,
    Can it be bacause of the file size? I have about 5 K rows on this sheet.
    It takes good 30 sec. to put the searched row in sheet 2.
    I cannot put data online.
    Thanks
    Sarah

  14. #14
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    Norie,
    It is only one row it brings to sheet2 with the specific ID it looks in col. 1 and 2
    I did not try filtering.
    Thanks
    Sarah

  15. #15
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Restricting search field

    Sarah

    If it's only one row why are you looping?

    Where are you looking for the ID?

    Is it only ever in columns 1 to 2?

  16. #16
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    Norie,
    My Ids are only in col 1 & 2. Actually I can live with only col. 1 too.
    As I said I took this code from this site. If I do not need looping how would that be?
    please note that it has to put back too, after I edit.
    Thank you
    Sarah

  17. #17
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Restricting search field

    Why do you need to move the row?

  18. #18
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    Norie,
    The ID is is col1. When it finds the ID, it copies the whole row to Sheet2 where I makes changes and the put back code puts it back in its place in sheet1
    Thanks
    Sarah

  19. #19
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    I need to edit/add info. and put it back.

  20. #20
    Registered User
    Join Date
    06-11-2010
    Location
    Hayward, CA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Restricting search field

    Hi Norie,
    The loop was taking all that time. Once I got rid of it, it works lot faster.
    Thanks anyway.
    Sarah

+ 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. Search a field with just part of a name
    By simon4amiee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-03-2013, 05:49 AM
  2. Search field help
    By enhydra in forum Access Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2011, 03:31 AM
  3. Restricting the search to one column
    By cheaperThanAPro in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 05-11-2007, 04:49 PM
  4. Search field?
    By philnad in forum Excel General
    Replies: 1
    Last Post: 03-30-2006, 02:15 PM
  5. [SOLVED] how can I search a field for a particular word
    By brantty in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 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