+ Reply to Thread
Results 1 to 5 of 5

Help finding value and notify

Hybrid View

  1. #1
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500

    Question no working

    thanks it works if i want it to say that it was not found but what i wanted was it to warn the typist that it has been entered in so that they know that they will be overwriting data.

    I tried modiefying your code to the below

    Columns("o:o").Select
    Id = Range("x5").Value

    Set abc = Selection.Find(What:=Id, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
    xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
    False)

    If abc Is Nothing Then
    ' MsgBox "not found"

    Else
    abc.Activate
    MsgBox "not found"
    End If

    some reason it finds the value but still says not found.

    any ideas??

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    some reason it finds the value but still says not found.
    It says not found because you placed the msgbox which gives this message in the else part. If you want to warn the typist, then change the if then to somthing like this:

    If abc Is Nothing Then
    ' MsgBox "not found"

    Else
    abc.Activate
    MsgBox "The value exists"
    End If

    Note: I have just changed the message in the message box.

    - Mangesh

  3. #3
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500

    Thumbs up stupid me

    of coarse logical answer cheers mate. been bashing my head against a brick wall try to solve it but was looking to in detail.

+ 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