Results 1 to 3 of 3

If user types in a wrong value, then an error message pops up

Threaded View

nenadmail If user types in a wrong... 08-10-2012, 02:01 PM
Pichingualas Re: If user types in a wrong... 08-10-2012, 02:07 PM
nenadmail Re: If user types in a wrong... 08-10-2012, 02:26 PM
  1. #1
    Forum Contributor
    Join Date
    05-19-2012
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    200

    If user types in a wrong value, then an error message pops up

    I have an array of Languages in: Range("C1:C100")

    The user types in a language in cell: "J4" then click NEXT BUTTON (runs a macro)
    If what he typed in does not match a language in the array, then an error message pops up saying: "That language is not supported. Please correct the language to continue."

    Here's the code where the error message needs to be added:
    Sub Step4()
        Dim i As Long
        Dim strAddress As String
        For i = 1 To 2
            strAddress = Choose(i, "G4", "J4")
            If Len(Trim(Range(strAddress).Value)) = 0 Then
                Range(strAddress).Select
                MsgBox "Please enter " & Choose(i, "the quantity of your order.", "the language of your order.")
                Exit Sub
            End If
        Next i
        Range("J4") = StrConv(Range("J4"), vbProperCase)
        Sheets("StatusAnnual").Range("Z1:AQ7").ClearContents
        Sheets("Image Catalog").Activate
        Range("DI11:DI25").Copy
        Range("CH47").Select
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Range("A87").Select
    End Sub
    Thanks!
    Last edited by nenadmail; 08-10-2012 at 02:05 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