LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default minutes aren't minutes?

Hi all,


I have long list of measurement timings with an interval of 10 minutes.

Like this:

time measure
1-1-2008 0:00 120
1-1-2008 0:10 117
1-1-2008 0:20 118

and so on for a whole month.

Sometimes however, there's a gap in time greater than 10 minutes.
I need to fill that gap with the missing time and also add NA for the
measure column. So I wrote the following rather straightforward code:

Sub fillmissing()
' create a gap of 10 minutes
difference = 1 / 24 / 6

Range("a2").Select
Do Until ActiveCell.Text = ""
jump = ActiveCell.Offset(1, 0).Value - ActiveCell.Value
If jump = dfference Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
ActiveCell.EntireRow.Insert
ActiveCell.Value = ActiveCell.Offset(-1, 0).Value + 1 / 24 / 6
ActiveCell.Offset(0, 1).Formula = "=NA()"

End If
Loop
End Sub

But, somehow Excel finds 10 minutes unequal to 1/24/6
So, when i run the code i end up with a long list of new gaps of 10
minutes and a NA value in the second column.

I can't put my finger on it.

Does anybody have any suggestions?

Thanks in advance,


Sybolt
 
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
Convert text entered as minutes/seconds to minutes Kathie Excel Worksheet Functions 1 May 6th 10 05:05 AM
Converting total minutes into hours and minutes in Excel colette Excel Worksheet Functions 11 December 26th 07 07:24 PM
converting Days Hours & minutes into just minutes in excel Six Sigma Blackbelt Excel Discussion (Misc queries) 5 April 28th 06 09:45 PM
how to change a decimal number (minutes) into hours and minutes? Erwin Excel Discussion (Misc queries) 2 November 5th 05 04:22 PM
add column of minutes, show total in hours & minutes glider pilot Excel Worksheet Functions 1 December 30th 04 10:27 PM


All times are GMT +1. The time now is 04:44 AM.

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"