+ Reply to Thread
Results 1 to 20 of 20

on error loop

  1. #1
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82

    on error loop

    Hi all,

    I have a search button that do a vlookup based on what option button is choosen. for a couple of weeks I have been trying to write a error handle but with no success. I want to write a few different handles but it doesn't work. here is my code. First handler I want to create is if not found please update the outlook list If not found again maybe a typo if not found choose another option than loop. I hope i explained this correctly..

    Please Login or Register  to view this content.
    Last edited by manforeyes; 01-12-2009 at 12:44 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why don't you use the VBA .Find method?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    how can you help ?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I'm not sure what you are doing.

  5. #5
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    o.k I inport info from my work info so I can lookup easier and put it on a certain worksheet now based on that work sheet it will perform a vlookup based on what I select

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Checking for errors with .Find is much easier, something like this

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    I have three criteria what do you mean do something else

  8. #8
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    what is LookIn:=xlValues)

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    take a look at the VBA helpfiles for .Find

    Do something else means exactly that, add code for whatver you want to do if the search is unsuccessful

  10. #10
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    cool like if nothing found go to 2 right ?

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Somethin like that

  12. #12
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    Hi again I tried the find however doesn't seem to work this is my latest attempt at error handler
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    what I am trying to do is prevent a run-time error to happenif the vlookup doesn't find what the user is searching for

  14. #14
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Did you try replacing all the VLOOKUPS with.Find?

  15. #15
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    yes but no luck

  16. #16
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    how would I return the value from the next row example someone searches for Pete Peterson than there alais will appear and so will there extension ?

  17. #17
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Please Login or Register  to view this content.
    You probably need to attach the workbook.
    Last edited by royUK; 01-12-2009 at 10:34 AM.

  18. #18
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    I just retried it not sure how to get the value in the next row like a vlookup

  19. #19
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    tried this sort of working what I want is the value next to it not bekow it

  20. #20
    Registered User
    Join Date
    12-05-2008
    Location
    Ottawa
    Posts
    82
    cool starting to work better I did this
    Please Login or Register  to view this content.

+ 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