problem with cell reference and date

N

NDBC

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.
 
J

Jacob Skaria

The first argument for CElls is Row...cells(row,column)

Range("u5")
is
Cells(5,21)

and not cells(21,5)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top