View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NDBC NDBC is offline
external usenet poster
 
Posts: 204
Default problem with cell reference and date

I am trying to pick up a time (date) out of cell u5. Can someone please tell
me why this

check1 = (Sheets("a grade").Range("u5"))

works and this

check2 = (Sheets("a grade").Cells(21, 5))

doesn't. Both check1 and check2 are dim as date and the value in u5 is
0.016018519

I'm not sure if it's relevant but the value in u5 is an elapsed time
generated by now()-start time. The start time is saved in a cell using a
button based on the now() command.

I have used check2=worksheetfunction.text(Sheets("a grade").Cells(21, 5)
"[hh]:mm:ss") but this doesn't work either.

Thanks for your help. It is driving me nuts.