Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Probably something really simple...

I'm trying to create a calendar/organiser within Excel to schedule a
workload. To do this, i've set up a page which has a list of all the
jobs, the time its due to start and also how long it will take.

On another tab, I have a visual representation of this using coloured
cells. What I'm trying to do is loop through the job page, take the
time when a job is due to start and then find the time on the second
tab and simply put a '1' in the adjacent cell.

The problem that i have is that I cannot get Excel to recognize my data
as a time, therefore for 12:00 the variable shows 0.5 on the 2nd tab,
however on the 1st tab, the cell which shows 12:00 actually has the
figure of 0.5000000002 so it does not see it as a match.

My times are all broken down into 5 minutes (9:00 9:05 etc)

Any advice??

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Probably something really simple...

..5 is 12:00 Noon. Time is stored as the fraction of a 24 hour day. So .5 is
half a day or 12 hours.


think you need a better way to check equality. Here is one approach - if
the are within a minute of each other, call it equal.
if abs(cell1-cell2) < TimeSerial(0,1,0) then
' we have a match
End if

30 seconds would be

if abs(cell1-cell2) < timeSerial(0,0,30) Then

as an example of a tighter test.

Another test could be

if format(cell1,"hh:mm") = format(cell2,"hh:mm") then

--
Regards,
Tom Ogilvy


"DAV135" wrote:

I'm trying to create a calendar/organiser within Excel to schedule a
workload. To do this, i've set up a page which has a list of all the
jobs, the time its due to start and also how long it will take.

On another tab, I have a visual representation of this using coloured
cells. What I'm trying to do is loop through the job page, take the
time when a job is due to start and then find the time on the second
tab and simply put a '1' in the adjacent cell.

The problem that i have is that I cannot get Excel to recognize my data
as a time, therefore for 12:00 the variable shows 0.5 on the 2nd tab,
however on the 1st tab, the cell which shows 12:00 actually has the
figure of 0.5000000002 so it does not see it as a match.

My times are all broken down into 5 minutes (9:00 9:05 etc)

Any advice??

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM


All times are GMT +1. The time now is 11:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"