Results 1 to 5 of 5

Mismatch Debbuging

Threaded View

  1. #1
    Registered User
    Join Date
    09-13-2008
    Location
    Barrie, ON, CA
    Posts
    47

    Mismatch Debbuging

    Hello,

    Below there is code for some inputboxs as well as some if statements on their results. The Exit sub situations work fine but If i do actually put a valid answer in the secod input box then it results in a mismatch error on the OR statement... Can anyone tell me why the first inputbox works fine but the second one gives me a type mismatch error when a valid input is given? Also if there's a more efficient way to do this please feel free to correct the code.

    Thanks

     Dim Month As String
      Dim Last As String
      Dim Added As String
      Answer = Application.InputBox(prompt:="Enter the name of the previous Month: I.E. July ", Type:=2)
      If Answer = "" Or Answer = False Then Ans = MsgBox("Last Month's Schedule Required", vbOK)
      If Ans = vbOK Then Exit Sub
      Last = Mid(Answer, 1, 3)
      Month = Application.InputBox(prompt:="Enter The Month to Reconcile: Exactly as shown in JDE Download/Explanation Alpha Name", Type:=2)
      If Month = "" Or Month = False Then Ans = MsgBox("Current Month's Information Required", vbOK)
      If Ans = vbOK Then Exit Sub
    Last edited by RBI; 10-09-2008 at 06:37 PM. Reason: Marked Solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Type Mismatch error 13
    By additude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2008, 08:08 AM
  2. Mismatch error
    By danielhliu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2008, 03:17 PM
  3. run-time error 13 type mismatch (urgent)
    By godster84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-27-2007, 06:48 AM
  4. VBA Type Mismatch Error
    By ecurns in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2007, 04:24 PM
  5. Type Mismatch Errors...
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2007, 09:32 AM

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