+ Reply to Thread
Results 1 to 6 of 6

How to I check if cell equals 48 ?

Hybrid View

  1. #1
    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


    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If ActiveCell.Value = "SICK" And Range("F4") = 0 And Range("G5") <= 0 Then
           MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"
    ElseIf ActiveCell.Value = "FMLA 1 Hours Paid" And Range("F4") = 0 And Range("G5") <= 0 Then
           MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"
    ElseIf ActiveCell.Value = "FMLA 2 Hours Paid" And Range("F4") = 0 And Range("G5") <= 0 Then
           MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"
    ElseIf ActiveCell.Value = "FMLA 3 Hours Paid" And Range("F4") = 0 And Range("G5") <= 0 Then
           MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"
    ElseIf ActiveCell.Value = "FMLA 4 Hours Paid" And Range("F4") = 0 And Range("G5") <= 0 Then
           MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"
    ElseIf ActiveCell.Value = "FMLA 5 Hours Paid" And Range("F4") = 0 And Range("G5") <= 0 Then
           MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"
    ElseIf ActiveCell.Value = "FMLA 6 Hours Paid" And Range("F4") = 0 And Range("G5") <= 0 Then
           MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"
    ElseIf ActiveCell.Value = "FMLA 7 Hours Paid" And Range("F4") = 0 And Range("G5") <= 0 Then
           MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"
    ElseIf ActiveCell.Value = "FMLA 8 Hours Paid" And Range("F4") = 0 And Range("G5") <= 0 Then
           MsgBox "The employee is out of excused sick days.", vbCritical, "Excused Sick Leave Left"
    End If
    End Sub
    Last edited by davi65; 12-27-2016 at 12:25 PM.

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

    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?

+ 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