+ Reply to Thread
Results 1 to 17 of 17

Macro to locate and go to specific data

  1. #1
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Macro to locate and go to specific data

    Hello

    I was hoping for some help please.

    I am trying to write a macro so that when i type a unique entry into cell A2 it then locates this unigue entry on my spreadsheet and scrolls down to it. So basically instead of using the find function manually using ctrl f, u just type what you are trying to find in cell A2 and it finds it. I am getting absolutely nowhere with this after downloading and adapting a number of templates. So if anybody can help i would be very grateful.

    Unfortunately i dont have the spreadsheet on this computer.

    Kind regards

    Joe

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Macro to locate and go to specific data

    I hope my solution will helps

    Check attached file.

    Best Regards
    Attached Files Attached Files

  3. #3
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Macro to locate and go to specific data

    This will go to the first instance after A2 on the worksheet:

    Please Login or Register  to view this content.
    If not found, it re-selects A2.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to locate and go to specific data

    Please Login or Register  to view this content.
    Last edited by snb; 06-08-2011 at 04:32 AM.



  5. #5
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to locate and go to specific data

    Thank You very much for your prompt help. They all seem to work brilliantly.

    But the problem is now that i have extended my workbook to include other worksheets, is it possible so that the search can be extended to these?

    Once again thanks for all your help.

    Joe

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to locate and go to specific data

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to locate and go to specific data

    thanks for your speedy response.

    it doesnt seem to be working though, is it because my worksheets are named June 2011, July 2011, August 2011 etc?

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to locate and go to specific data

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to locate and go to specific data

    !! its still not working

    probably because of lack of information on my part, so have attached a dummy file and hopefully it will make things clearer.
    Attached Files Attached Files

  10. #10
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to locate and go to specific data

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to locate and go to specific data

    thanks for all your help but i still cant get it to work

    ive tried tinkering to no avail and borrowing code from other macros but nothing is working


    if i search for a june address it finds them but if i search for a july address nothing happens, where am i going wrong?

  12. #12
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Macro to locate and go to specific data

    I think if the sheet it tries to find it on is after the sheet that you type into, it will find the one on the sheet you type into (the one you typed in), and stop looking.

    Does this slight modification to snb's code work?

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to locate and go to specific data

    Hi Dave and Snb

    Thanks for that, but no, it still is only picking up June's dates but not any other months on the other sheets.

    Would it make it work if i put the search on a seperate page and the code was modified to disclude any items found on the search page and so automatically goes to the correct dates?

    If so do you know what code that would be.

    Once again thanks for all your help and perseverance!

    Joe

  14. #14
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to locate and go to specific data

    Please Login or Register  to view this content.

  15. #15
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,298

    Re: Macro to locate and go to specific data

    Try:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  16. #16
    Registered User
    Join Date
    09-23-2009
    Location
    liverpool, england
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Macro to locate and go to specific data

    Thats Brilliant!!!!


    Thank you so much for all your help!!!!



    Really appreciate it

  17. #17
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,298

    Re: Macro to locate and go to specific data

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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