Need help with a formula

H

htmldiva

I am working on a timesheet. I have a dropdown list (Cell W8) wit
categories of time, a cell with manual hours (Cell M8) and a cell wit
converted hours (Cell L8) (formula =(K8-INT(K8))*24). I want to use
formula to show if Cell W8 = General and Cell L8 is less than or equa
to Cell M8 to perform an action. Here's my formula.

If Range("W8").Value = "General" And Range("L8").Value <
Range("M8").Value Then
Range("w8").Interior.ColorIndex = 46
MsgBox ("Adjust numbers for time off or change the type to General
or Holiday, then recalculate.")
Range("o35").Value = "Error Alert! Please review and recalculat
timesheet"

I can get the formula to recognize less than and greater than, but i
it's equal to it still performs as if it's less than. Can you help
 
O

optionbase1

could you clarify?

as I see it ....

you have defined your IF to recognise the "if L8 is less than or Equal
to M8"; but then you say you don't want this in the last line.

you can remove the ='s sign in the <= to stop this behaviour ...?

is that right?
 
B

Bob Phillips

Do you mean

If Range("W8").NumberFormat = "General" And Range("L8").Value <
Range("M8").Value Then
Range("w8").Interior.ColorIndex = 46
MsgBox ("Adjust numbers for time off or change the type to General or
Holiday, then recalculate.")
Range("o35").Value = "Error Alert! Please review and recalculate
timesheet"
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top