+ Reply to Thread
Results 1 to 4 of 4

Error Box

  1. #1
    Registered User
    Join Date
    05-26-2005
    Posts
    56

    Error Box

    Simple problem i know but i am hitting a blank with this one. I have a macro that reads:

    If Range("N57") = "" Then
    Else

    Before the Else i want a warning box in there instead ot the do nothing that is currently in there. I just want it to read something like "Please Enter a Value".

    any takers?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Chalky,

    Try using an InputBox...

    If Range("M57") = "" Then
    Answer = InputBox("Please enter a value.")
    If Answer <> "" Then Range("M57") = Answer
    Else
    ....
    End If

    Sincerely,
    Leith Ross

  3. #3
    Bob Phillips
    Guest

    Re: Error Box

    Do
    If Range("N57") = "" Then
    Range("N57").Value = Inputbox("Please Enter a Value")
    Else
    '...
    End If
    Loop Until Range("N57").Value <> ""

    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "chalky" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Simple problem i know but i am hitting a blank with this one. I have a
    > macro that reads:
    >
    > If Range("N57") = "" Then
    > Else
    >
    > Before the Else i want a warning box in there instead ot the do nothing
    > that is currently in there. I just want it to read something like
    > "Please Enter a Value".
    >
    > any takers?
    >
    >
    > --
    > chalky
    > ------------------------------------------------------------------------
    > chalky's Profile:

    http://www.excelforum.com/member.php...o&userid=23758
    > View this thread: http://www.excelforum.com/showthread...hreadid=509435
    >




  4. #4
    Tom Ogilvy
    Guest

    Re: Error Box

    If Range("N57") = "" Then
    MsgBox "Please Enter Value"
    exit sub
    Else


    An Alternative

    Dim as as Variant
    If Range("N57") = "" Then
    ans = InputBox("Please Enter a Value for ""N57""")
    if not isnumeric(ans) then
    exit sub
    else
    Range("N57").Value = ans
    end if
    End if

    --
    Regards,
    Tom Ogilvy


    --
    Regards,
    Tom Ogilvy



    "chalky" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Simple problem i know but i am hitting a blank with this one. I have a
    > macro that reads:
    >
    > If Range("N57") = "" Then
    > Else
    >
    > Before the Else i want a warning box in there instead ot the do nothing
    > that is currently in there. I just want it to read something like
    > "Please Enter a Value".
    >
    > any takers?
    >
    >
    > --
    > chalky
    > ------------------------------------------------------------------------
    > chalky's Profile:

    http://www.excelforum.com/member.php...o&userid=23758
    > View this thread: http://www.excelforum.com/showthread...hreadid=509435
    >




+ 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