Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Below is my code. It is supposed to look for the value "999" in the two
ranges specified and if "999" is in either range give the message box. However, it doesn't seem to be working. Here are a couple possible problems. Other values are in some of the cells in the target range (i.e. "898"). Everyother cell in the target range is merged together (i.e. AD18 and AD19 are merged into one cell). Please advise. Dim x As Boolean With Application x = .CountIf(Sheets("T.S. (2)").Range("AD18:AD44"), 999) + ..CountIf(Sheets("T.S. (2)").Range("AD67:AD99"), 999) End With If x = True Then Msg = "This employee has included the 999 code on his/her time sheet! Is this a 75 hour leave without pay time sheet?" Ans = MsgBox(Msg, vbYesNo) If Ans = vbYes Then With Worksheets("Worksheet") .Range("B9:I15,L9:S15,V4").Value = 0 End With End If If Ans = vbNo Then Msg = "Please remove the 999 code from their time sheet." Ans = MsgBox(Msg, vbOKOnly) ActiveWindow.ActivateNext End If End If -- Thanks Shawn |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search range for text not in another range | Excel Discussion (Misc queries) | |||
How to search a range for a suburb in a large range | Excel Programming | |||
Can I search a range | Excel Programming | |||
Search for #'s in range | Excel Programming | |||
Search a value in particular range | Excel Programming |