Results 1 to 6 of 6

Input Box prompts Message Box

Threaded View

  1. #1
    Registered User
    Join Date
    11-22-2011
    Location
    Edinburgh
    MS-Off Ver
    Excel 2003
    Posts
    17

    Input Box prompts Message Box

    Hi,

    I am writing some (fairly basic) code where a user inputs a number to an input box which is then copied to a cell but I am trying to add a little extra functionality whereby if the value input results in an error i.e. the details related to that number are 'not found' (by a vlookup with an if in a different cell) then an message box is displayed with "Not Found". I've had a bash with little success but I think it's mainly because I don't know where to place the lines in my code.

    Hope you can help.

    Thanks

    Sub New_Search()
    
        Dim strSearch As String
        
        strSearch = InputBox("Enter Agreement No.", "New Search")
          
        If strSearch <> "" Then Sheets("Sold Lookup").Range("E5").Value = strSearch
        If strSearch = "" Then Sheets("Sold Lookup").Range("E5").Value = ""
        
    End Sub
    Last edited by cfherd; 05-04-2012 at 07:10 AM.

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