+ Reply to Thread
Results 1 to 5 of 5

msgbox based on cell entry

  1. #1
    Robert
    Guest

    msgbox based on cell entry

    I want to write code that will automatically check cells in a range for
    certain data input and give a message when certain data is entered.

    I have this code and can call it from an IF function but would liike it to
    automatically check the selected cell without having a column that references
    each cell.

    Sub GiveNotice()
    Dim Msg As Variant
    Msg = "If B170 make sure C/O is not 82xx. "
    Msg = Msg & vbCrLf
    Msg = Msg & "If 9998 make sure Function Code is correct. "
    Msg = Msg & vbCrLf
    Msg = Msg & "If 9999 make sure Function Code is 999. "
    MsgBox (Msg)

    End Sub

    Function WarningNotice()
    Call GiveNotice
    End Function

    --
    Robert

  2. #2
    Paul Martin
    Guest

    Re: msgbox based on cell entry

    Robert

    Your function does not return anything so it should be a Sub.
    Your problem is not particularly clear. Can you clarify?

    Regards

    Paul Martin
    Melbourne, Australia


  3. #3
    Robert
    Guest

    Re: msgbox based on cell entry

    In my spreadsheet I have a column next to the one with the data. I have
    entered If(or(f14="B170",9998,9999),WarningNotice,""). This gives me the
    msgbox that I want. But I would like to get the message box without the
    additional column with the IF function in each cell adjacent to the cell with
    data.
    --
    Robert


    "Paul Martin" wrote:

    > Robert
    >
    > Your function does not return anything so it should be a Sub.
    > Your problem is not particularly clear. Can you clarify?
    >
    > Regards
    >
    > Paul Martin
    > Melbourne, Australia
    >
    >


  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Robert

    Why are you using code for this?

    Surely you could use Data>Validation...

    By the way your OR(f14="B170",9998,9999) will always return true.

  5. #5
    Robert
    Guest

    Re: msgbox based on cell entry

    Because data validation will only let you enter one of these, all others are
    excluded. There are many others I could enter. I want a message to pop up
    when one of these is entered in the column.
    --
    Robert


    "Norie" wrote:

    >
    > Robert
    >
    > Why are you using code for this?
    >
    > Surely you could use Data>Validation...
    >
    > By the way your OR(f14="B170",9998,9999) will always return true.
    >
    >
    > --
    > Norie
    > ------------------------------------------------------------------------
    > Norie's Profile: http://www.excelforum.com/member.php...o&userid=19362
    > View this thread: http://www.excelforum.com/showthread...hreadid=374418
    >
    >


+ 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