ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Variable Not in the cell (https://www.excelbanter.com/excel-programming/301165-variable-not-cell.html)

rebel1970

Variable Not in the cell
 
Hi there,

Can anyone help me.... I have a macro which copies a variable to
cell.

The variable format will always be dd/mm/yyyy

However, this information makes its way to the cell but it doesnt see
to be the value of the cell.... its almost as if it is text sitting o
the cell and not a value. Like for example ="22/09/2008"

Any help much appreciated



--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Variable Not in the cell
 
Dim dt as Date
dt = Cdate("22/09/2008")
ActiveCell.Value = dt
ActiveCell.Numberformat = "dd/mm/yyyy"

--
Regards,
Tom Ogilvy

"rebel1970 " wrote in message
...
Hi there,

Can anyone help me.... I have a macro which copies a variable to a
cell.

The variable format will always be dd/mm/yyyy

However, this information makes its way to the cell but it doesnt seem
to be the value of the cell.... its almost as if it is text sitting on
the cell and not a value. Like for example ="22/09/2008"

Any help much appreciated

R


---
Message posted from http://www.ExcelForum.com/




rebel1970[_2_]

Variable Not in the cell
 
Thanks To

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 02:08 PM.

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