Ruts
New Member
- Joined
- Sep 13, 2008
- Messages
- 27
Hey guys and girls, this is doing my head in - the concept works fine if I write it in cells on a sheet - so it "SHOULD" work in my VBA but it isn't.
Quite possibly I am missing the simplest thing and just am too close to see it.
Anybody see where I have buggered it up ??
Below are the relevant snippets of the code - all the DIMS statements are at the start of the code with the variables defined immediately prior to display.
timeCalcColumns returns a value of 54
timeCalcRows returns a value of 102
processTime is the value determined to process each cell * the number of cells (5508)
using these values processing time should = 29 secs - but it shows as ZERO
any help on what I have done wrong will be very greatly appreciated.
Quite possibly I am missing the simplest thing and just am too close to see it.
Anybody see where I have buggered it up ??
Below are the relevant snippets of the code - all the DIMS statements are at the start of the code with the variables defined immediately prior to display.
Code:
Dim timeCalcColumns As Integer ' The number of columns of data - used to determine max cells to process
Dim timeCalcRows As Integer ' The number of rows of data - used to determine max cells to process
Dim timeStart As String
Dim timeFinish As String
Dim processCells As Long
Dim processTime As Long
Dim actualHour As Long
Dim actualMinute As Long
Dim actualSecond As Long
Dim remainingMinute As Long
Dim remainingSecond As Long
processCells = timeCalcRows * timeCalcColumns
processTime = processCells * 6.10269370636987E-08
actualHour = Int(processTime * 24)
actualMinute = processTime * 24 * 60
actualSecond = processTime * 24 * 60 * 60
remainingMinute = Int(actualMinute - (actualHour * 60))
remainingSecond = Int(actualSecond - (actualMinute * 60))
MsgBox "About to process " & timeCalcRows & " personnel " & "and " & timeCalcColumns & " accomplishments." & Chr$(10) & Chr$(10) & "Processing should take approximately : " & actualHour & " hours " & remainingMinute & " minutes " & remainingSecond & " seconds."
timeCalcColumns returns a value of 54
timeCalcRows returns a value of 102
processTime is the value determined to process each cell * the number of cells (5508)
using these values processing time should = 29 secs - but it shows as ZERO
any help on what I have done wrong will be very greatly appreciated.