Results 1 to 20 of 20

on error loop

Threaded View

manforeyes on error loop 01-10-2009, 12:21 PM
royUK Why don't you use the VBA... 01-10-2009, 12:38 PM
manforeyes how can you help ? 01-10-2009, 12:39 PM
royUK I'm not sure what you are... 01-10-2009, 12:52 PM
manforeyes o.k I inport info from my... 01-10-2009, 12:55 PM
royUK Checking for errors with... 01-10-2009, 01:13 PM
manforeyes I have three criteria what ... 01-10-2009, 01:16 PM
manforeyes what is LookIn:=xlValues) 01-10-2009, 01:23 PM
royUK take a look at the VBA... 01-10-2009, 01:28 PM
manforeyes cool like if nothing found go... 01-10-2009, 01:31 PM
royUK Somethin like that 01-10-2009, 02:08 PM
manforeyes Hi again I tried the find... 01-12-2009, 08:45 AM
manforeyes what I am trying to do is... 01-12-2009, 10:05 AM
royUK Did you try replacing all the... 01-12-2009, 10:17 AM
manforeyes yes but no luck 01-12-2009, 10:17 AM
manforeyes how would I return the value... 01-12-2009, 10:24 AM
royUK Dim cl As Range If... 01-12-2009, 10:31 AM
manforeyes I just retried it not sure... 01-12-2009, 10:32 AM
manforeyes tried this sort of working... 01-12-2009, 10:36 AM
manforeyes cool starting to work better... 01-12-2009, 10:38 AM
  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..

    Private Sub cmdsearch_Click()
    Dim a As String
    Dim b As String
    Dim c As String
    Dim answer As String
    Dim answer2 As String
    
    
              
    
    'Continue:
    'On Error GoTo trap
    'On Error GoTo trap2
    'If obtclient.Value = False And optalias.Value = False Then
     ' MsgBox "Select an option to search for client", vbOKCancel'
    
    If obtclient.Value = True Then
    a = Application.WorksheetFunction.VLookup(Worksheets("INPUT").Range("B1"), Worksheets("Outlook Info").Range("a1:C10000"), 2, False)
    txtCname = txtsearch
    txtAlais = a
    txtphone = Application.WorksheetFunction.VLookup(Worksheets("INPUT").Range("B1"), Worksheets("Outlook Info").Range("a1:c10000"), 3, False)
    ElseIf optalias.Value = True Then
    b = Application.WorksheetFunction.VLookup(Worksheets("INPUT").Range("B1"), Worksheets("Outlook Info").Range("D1:F10000"), 3, False)
    txtAlais.Value = txtsearch
    txtCname = b
    txtphone = Application.WorksheetFunction.VLookup(Worksheets("INPUT").Range("B1"), Worksheets("Outlook Info").Range("D1:F10000"), 2, False)
    
    Else
    optphone.Value = True
    c = Application.WorksheetFunction.VLookup(Worksheets("INPUT").Range("B1"), Worksheets("Outlook Info").Range("g1:I10000"), 2, False)
    
     
    txtphone = txtsearch
    txtCname = c
    txtAlais = Application.WorksheetFunction.VLookup(Worksheets("INPUT").Range("B1"), Worksheets("Outlook Info").Range("g1:I10000"), 3, False)
    
    End If
    
    
    
    
     lblstartup.Visible = False
     lblstartup2.Visible = False
     
     lbldate.Visible = True
    txtdate.Visible = True
    'Frame3.Visible = False
    Frame2.Visible = True
    Frame5.Visible = True
    lblissue.Visible = True
    txtissue.Visible = True
    cmdsi.Visible = True
    lbltitle.Visible = True
    txttitle.Visible = True
    lblsystem.Visible = True
    txtsystem.Visible = True
    lblcomponent.Visible = True
    txtcomp.Visible = True
    lblitem.Visible = True
    txtitem.Visible = True
    Label4.Visible = True
    txtassign.Visible = True
    lbldescription.Visible = True
    txtdescription.Visible = True
    Label5.Visible = True
    txtsolution.Visible = True
     
     ' Resume Continue
      
    
    
    'answer = MsgBox("yes", vbQuestion + vbOKCancel, "Error")
    'If answer = vbOK Then Resume Continue
    
    'trap2:
    'answer2 = MsgBox("no", vbQuestion + vbOKCancel, "Error")
    'If answer2 = vbOK Then Resume Continue
    
    
    'MsgBox "Select an option to search for client", vbOKCancel
    
    
    
    
    
    
    End Sub
    Last edited by manforeyes; 01-12-2009 at 12:44 PM.

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