ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cell date value (https://www.excelbanter.com/excel-programming/427575-cell-date-value.html)

greg

cell date value
 
OK,
this must be an easy one.
I have a named cell. Start_date
The cell is formated as date. with a date value 7/1/2010
when trying to get the cell value I do not get the date
range("start_date").Value2
It comes out:
40360

so must be something easy.
anyone have an answer?
thanks



Rick Rothstein

cell date value
 
Why are you using Value2? Try using this...

Range("Start_Date").Value

Or, you can format the date value from Value2 yourself....

Format(Range("Start_Date").Value2, "m/d/yyyy")

--
Rick (MVP - Excel)


"greg" wrote in message
...
OK,
this must be an easy one.
I have a named cell. Start_date
The cell is formated as date. with a date value 7/1/2010
when trying to get the cell value I do not get the date
range("start_date").Value2
It comes out:
40360

so must be something easy.
anyone have an answer?
thanks



Mike H

cell date value
 
Greg,

Try this

Mydate = Format(Range("start_date"), "dd/mm/yyyy")

Mike

"greg" wrote:

OK,
this must be an easy one.
I have a named cell. Start_date
The cell is formated as date. with a date value 7/1/2010
when trying to get the cell value I do not get the date
range("start_date").Value2
It comes out:
40360

so must be something easy.
anyone have an answer?
thanks




Jacob Skaria

cell date value
 
Try

=Format(range("start_Date"),"dd-mm-yyyy")

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


"greg" wrote:

OK,
this must be an easy one.
I have a named cell. Start_date
The cell is formated as date. with a date value 7/1/2010
when trying to get the cell value I do not get the date
range("start_date").Value2
It comes out:
40360

so must be something easy.
anyone have an answer?
thanks




greg

cell date value
 
Thanks
What is the diff between value and value2?

"Rick Rothstein" wrote in message
...
Why are you using Value2? Try using this...

Range("Start_Date").Value

Or, you can format the date value from Value2 yourself....

Format(Range("Start_Date").Value2, "m/d/yyyy")

--
Rick (MVP - Excel)


"greg" wrote in message
...
OK,
this must be an easy one.
I have a named cell. Start_date
The cell is formated as date. with a date value 7/1/2010
when trying to get the cell value I do not get the date
range("start_date").Value2
It comes out:
40360

so must be something easy.
anyone have an answer?
thanks





Rick Rothstein

cell date value
 
From the Remarks section of the VBA Help Files for Value2...

"The only difference between this property and
the Value property is that the Value2 property
doesn't use the Currency and Date data types."

The fastest way to check a keyword out in the VBA Help Files is to type the
word in any code window and, with the text cursor in or next to the word,
press F1.

--
Rick (MVP - Excel)


"greg" wrote in message
...
Thanks
What is the diff between value and value2?

"Rick Rothstein" wrote in message
...
Why are you using Value2? Try using this...

Range("Start_Date").Value

Or, you can format the date value from Value2 yourself....

Format(Range("Start_Date").Value2, "m/d/yyyy")

--
Rick (MVP - Excel)


"greg" wrote in message
...
OK,
this must be an easy one.
I have a named cell. Start_date
The cell is formated as date. with a date value 7/1/2010
when trying to get the cell value I do not get the date
range("start_date").Value2
It comes out:
40360

so must be something easy.
anyone have an answer?
thanks






greg

cell date value
 
thanks all


"Jacob Skaria" wrote in message
...
Try

=Format(range("start_Date"),"dd-mm-yyyy")

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


"greg" wrote:

OK,
this must be an easy one.
I have a named cell. Start_date
The cell is formated as date. with a date value 7/1/2010
when trying to get the cell value I do not get the date
range("start_date").Value2
It comes out:
40360

so must be something easy.
anyone have an answer?
thanks







All times are GMT +1. The time now is 03:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com