ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   writing to a cell (https://www.excelbanter.com/excel-programming/271980-writing-cell.html)

Michael Miazga[_2_]

writing to a cell
 
I know this HAS to be simple, but I can't find the command anywhere, driving
me crazy. I'm just trying to write to a cell the current date. only in
mm/dd/yyyy format. something like this, but it isn't right:

With curWks
.Range("J31").Clear
.Range("J31").Bold = True
.Range("J31").Text (Date)
End with




Michael Miazga[_2_]

writing to a cell
 
God, I finally got it..

..Range("J31").Value = Date

works.

"Michael Miazga" wrote in message
...
I know this HAS to be simple, but I can't find the command anywhere,

driving
me crazy. I'm just trying to write to a cell the current date. only in
mm/dd/yyyy format. something like this, but it isn't right:

With curWks
.Range("J31").Clear
.Range("J31").Bold = True
.Range("J31").Text (Date)
End with






Richard Choate

writing to a cell
 
Outside of the With statement:

ActiveCell = Format(Date, "mm/dd/yyyy")

Richard

"Michael Miazga" wrote in message
...
I know this HAS to be simple, but I can't find the command anywhere, driving
me crazy. I'm just trying to write to a cell the current date. only in
mm/dd/yyyy format. something like this, but it isn't right:

With curWks
.Range("J31").Clear
.Range("J31").Bold = True
.Range("J31").Text (Date)
End with





Ryan Poth[_2_]

writing to a cell
 
Try replacing

..Range("J31").Text (Date)

with

..Range("J31").Value = Date

Regards,
Ryan

-----Original Message-----
I know this HAS to be simple, but I can't find the

command anywhere, driving
me crazy. I'm just trying to write to a cell the current

date. only in
mm/dd/yyyy format. something like this, but it isn't

right:

With curWks
.Range("J31").Clear
.Range("J31").Bold = True
.Range("J31").Text (Date)
End with



.



All times are GMT +1. The time now is 01:55 AM.

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