+ Reply to Thread
Results 1 to 3 of 3

Type Mismatch error on InputBox

Hybrid View

h_aesa1 Type Mismatch error on... 10-16-2009, 01:41 PM
DonkeyOte Re: Type Mismatch error on... 10-16-2009, 01:52 PM
h_aesa1 Re: Type Mismatch error on... 10-17-2009, 09:21 AM
  1. #1
    Registered User
    Join Date
    02-09-2009
    Location
    Washington, US
    MS-Off Ver
    Excel 2003
    Posts
    73

    Type Mismatch error on InputBox

    I am trying to only have the option 1, 2, or 3 be entered. I have that part down, but if someone clicks cancel or just closes the input box i get the type mismatch I believe because no integer was found....is there a way around this?

    thanks

    here is the code I am using

    HTML Code: 

    thanks,

    JJ
    Last edited by h_aesa1; 10-17-2009 at 09:24 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Type Mismatch error on InputBox

    First, try using Application.InputBox as this gives you a little more control in terms of validation...

    Dim intResponse As Integer
    intResponse = Application.InputBox("Choose One" & Chr(10) & Chr(10) & "1 - Lease Lock" & Chr(10) & "2 - Upgrade" & Chr(10) & "3 - Lease Lock & Upgrade", "Contract(s) sent out", Type:=1)
    Select Case intResponse
        Case 1 To 3
        Case Else
            MsgBox "Must choose (1,2,3)"
            Exit Sub
    End Select
    Last edited by DonkeyOte; 10-17-2009 at 09:23 AM.

  3. #3
    Registered User
    Join Date
    02-09-2009
    Location
    Washington, US
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Type Mismatch error on InputBox

    thank you very much...that works wonders!!!

+ 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