Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use the code below to check to see if the minutes in a day total
1440, for some reason, I am getting the MsgBox telling me that C56 does not equal 1440. I have physically checked this, and can see the value 1440 in C56 from the formula =SUM(C55,D55) If Sheets("Sheet1").Range("C56").Value < 1440 Then MsgBox ("Please Check You Planned Running Time, it does not add up to 1440") Exit Sub End If Any ideas? Thanks Pete |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Pete
could it be a rounding error? ... try in C56 =ROUND(C55+D55,0) -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Pete" wrote in message oups.com... I use the code below to check to see if the minutes in a day total 1440, for some reason, I am getting the MsgBox telling me that C56 does not equal 1440. I have physically checked this, and can see the value 1440 in C56 from the formula =SUM(C55,D55) If Sheets("Sheet1").Range("C56").Value < 1440 Then MsgBox ("Please Check You Planned Running Time, it does not add up to 1440") Exit Sub End If Any ideas? Thanks Pete |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Julie
Changed my formula to suit your version, and all ok. I've checked the other cells that this value relies on, and all seem (Look) OK any ideas? Thanks Pete |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
just looked, and when I print this cell value in the immediate window,
it definately shows 1440 before changing the formula to your version Pete |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Pete
do you want to send the file across to me and i'll see if i can spot what is going on ... julied_ng at hcts dot net dot au -- Cheers JulieD check out www.hcts.net.au/tipsandtricks.htm ....well i'm working on it anyway "Pete" wrote in message oups.com... just looked, and when I print this cell value in the immediate window, it definately shows 1440 before changing the formula to your version Pete |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think I've spotted it, I calculate downtime with the following
formula U16=13:00, W16=14:00 (W16-U16+(W16<U16))*1440 Gives me 60 min downtime I use =INT(G16/60) to get hours (=1) I use =MOD(G16,60) to get mins (=0) For some reason (W16-U16+(W16<U16))*1440 =60.0000000000001 What I've done is ROUND((W16-U16+(W16<U16))*1440) Which appears to work. I don't mind sending you the sheet, but it isn't pretty Pete |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Pete,
A simple change would be If Sheets("Sheet1").Range("C56").Text < 1440 Then or If Sheets("Sheet1").Range("C56").Text < "1440" Then ..Text returns what the cell actually shows, and Excel coerces the value, so either works. HTH, Bernie MS Excel MVP "Pete" wrote in message oups.com... I use the code below to check to see if the minutes in a day total 1440, for some reason, I am getting the MsgBox telling me that C56 does not equal 1440. I have physically checked this, and can see the value 1440 in C56 from the formula =SUM(C55,D55) If Sheets("Sheet1").Range("C56").Value < 1440 Then MsgBox ("Please Check You Planned Running Time, it does not add up to 1440") Exit Sub End If Any ideas? Thanks Pete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) | |||
Question: Cell formula or macro to write result of one cell to another cell | Excel Programming |