Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 204
Default problem with cell reference and date

must be getting tired. Just tried cells(5, 21) and it worked a lot better.



"NDBC" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default problem with cell reference and date

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

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

and not cells(21,5)

--
If this post helps click Yes
---------------
Jacob Skaria


"NDBC" wrote:

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.

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
Problem w/ cell reference WLMPilot Excel Discussion (Misc queries) 2 March 30th 08 03:54 PM
dim problem when using cell() reference aimee209 Excel Programming 6 March 10th 08 07:06 PM
Cell reference problem Jim Olsen Excel Worksheet Functions 4 October 31st 05 05:47 AM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


All times are GMT +1. The time now is 05:42 AM.

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

About Us

"It's about Microsoft Excel"