+ Reply to Thread
Results 1 to 6 of 6

How to I check if cell equals 48 ?

  1. #1
    Registered User
    Join Date
    10-28-2016
    Location
    new york
    MS-Off Ver
    A+
    Posts
    62

    How to I check if cell equals 48 ?

    How to I check if cell F5 = 48 ? and then show up a message. Here is what I am using.

    The problem is that the work "Sick" Change all the time and then the message don't show up. I just want to check cell F4 = 0 AND f5 =48 THEN MESSAGE.
    Private Sub Worksheet_Change(ByVal Target As Range)


    If ActiveCell.Value = "SICK" And Range("F4") = 0 And Range("F5") = 48 Then
    MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"



    End If
    End Sub
    Last edited by davi65; 12-22-2016 at 01:21 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to I check if cell equals 48 ?

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: How to I check if cell equals 48 ?

    Simplify the code,
    you should set the target range though so the code doesn't kick in every time there is a change in the worksheet.


    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-28-2016
    Location
    new york
    MS-Off Ver
    A+
    Posts
    62

    Re: How to I check if cell equals 48 ?

    Good Morning,

    How can I stop the message to show up every time I select a option . i want the message to show up one time only. When F4 = 0


    Please Login or Register  to view this content.
    Last edited by davi65; 12-27-2016 at 12:25 PM.

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: How to I check if cell equals 48 ?

    My previous answer mentions that you need to set the target range, what is the target range?

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: How to I check if cell equals 48 ?

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.




    AddFile.jpg

    To add a file to a post

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA to check if cell A1 in workbook 1 equals cell A1 in workbook 2
    By Rerock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2014, 01:06 PM
  2. Code to check in cell equals a value, if true copy row.
    By creekybones in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2014, 04:10 PM
  3. Check range equals 100%
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2014, 08:55 AM
  4. Check if cell value exists in row and if date in row equals date in column
    By rskay14 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2014, 02:51 AM
  5. Check if a filename contains (not equals) the value of a cell
    By kevv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2013, 10:27 AM
  6. If cell value equals then check another cell.
    By stuntmannen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2011, 05:30 AM
  7. Using condition format to check if day equals Friday
    By Zyphon in forum Excel General
    Replies: 4
    Last Post: 05-20-2007, 05:57 PM

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