ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Placing time with date (https://www.excelbanter.com/excel-programming/398670-placing-time-date.html)

Mike K

Placing time with date
 
Oh Wise Ones,
We have a disposition file that records a date the
entry was made among other things. I would like to add the time to that
stamp. I know this is simple for you programmers but I need help with the
syntax.

Current code:

Worksheets("Open Red Tags").Range("J4") = Date

I would like to add the date AND time to J4, but preferably keep the
formatting to display only the date (M/D/YYYY) . Could someone please help?

Thanks,
Mike

Sam Wilson

Placing time with date
 

Worksheets("Open Red Tags").Range("J4")=format(now(),"MM/DD/YYYY")

"Mike K" wrote:

Oh Wise Ones,
We have a disposition file that records a date the
entry was made among other things. I would like to add the time to that
stamp. I know this is simple for you programmers but I need help with the
syntax.

Current code:

Worksheets("Open Red Tags").Range("J4") = Date

I would like to add the date AND time to J4, but preferably keep the
formatting to display only the date (M/D/YYYY) . Could someone please help?

Thanks,
Mike


John Bundy

Placing time with date
 
instead of =Date, see if =Now() works for you.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Mike K" wrote:

Oh Wise Ones,
We have a disposition file that records a date the
entry was made among other things. I would like to add the time to that
stamp. I know this is simple for you programmers but I need help with the
syntax.

Current code:

Worksheets("Open Red Tags").Range("J4") = Date

I would like to add the date AND time to J4, but preferably keep the
formatting to display only the date (M/D/YYYY) . Could someone please help?

Thanks,
Mike


Sam Wilson

Placing time with date
 
Actually you need

with range("J4")
.value = now()
.numberformat="MM/DD/YYYY"
end with

"Sam Wilson" wrote:


Worksheets("Open Red Tags").Range("J4")=format(now(),"MM/DD/YYYY")

"Mike K" wrote:

Oh Wise Ones,
We have a disposition file that records a date the
entry was made among other things. I would like to add the time to that
stamp. I know this is simple for you programmers but I need help with the
syntax.

Current code:

Worksheets("Open Red Tags").Range("J4") = Date

I would like to add the date AND time to J4, but preferably keep the
formatting to display only the date (M/D/YYYY) . Could someone please help?

Thanks,
Mike


JRForm

Placing time with date
 
Mike k,

= Format(Date, "ddddd") & " " & Format(Time, "ttttt")

"Mike K" wrote:

Oh Wise Ones,
We have a disposition file that records a date the
entry was made among other things. I would like to add the time to that
stamp. I know this is simple for you programmers but I need help with the
syntax.

Current code:

Worksheets("Open Red Tags").Range("J4") = Date

I would like to add the date AND time to J4, but preferably keep the
formatting to display only the date (M/D/YYYY) . Could someone please help?

Thanks,
Mike


Mike K

Placing time with date
 
Sam,
Pardon my ignorance but how do I place this to refer to the proper
sheet?
The previous line is:

Worksheets("Red Tag").Range("H20,H46") = Date

which is ok, but then I need to refer to another sheet

Worksheets("Open Red Tags").Range ("J4")= Date

and replace it with this:

Worksheets ("Open Red Tags")
With Range("J4")
.Value = Now()
.NumberFormat = "MM/DD/YYYY"
End With

I get an invalid use of property error.

Mike

"Sam Wilson" wrote:

Actually you need

with range("J4")
.value = now()
.numberformat="MM/DD/YYYY"
end with

"Sam Wilson" wrote:


Worksheets("Open Red Tags").Range("J4")=format(now(),"MM/DD/YYYY")

"Mike K" wrote:

Oh Wise Ones,
We have a disposition file that records a date the
entry was made among other things. I would like to add the time to that
stamp. I know this is simple for you programmers but I need help with the
syntax.

Current code:

Worksheets("Open Red Tags").Range("J4") = Date

I would like to add the date AND time to J4, but preferably keep the
formatting to display only the date (M/D/YYYY) . Could someone please help?

Thanks,
Mike


Sam Wilson

Placing time with date
 

Sorry, use this:

With worksheets("Open Red Tags").Range("J4")
.Value = Now()
.NumberFormat = "MM/DD/YYYY"
End With

"Mike K" wrote:

Sam,
Pardon my ignorance but how do I place this to refer to the proper
sheet?
The previous line is:

Worksheets("Red Tag").Range("H20,H46") = Date

which is ok, but then I need to refer to another sheet

Worksheets("Open Red Tags").Range ("J4")= Date

and replace it with this:

Worksheets ("Open Red Tags")
With Range("J4")
.Value = Now()
.NumberFormat = "MM/DD/YYYY"
End With

I get an invalid use of property error.

Mike

"Sam Wilson" wrote:

Actually you need

with range("J4")
.value = now()
.numberformat="MM/DD/YYYY"
end with

"Sam Wilson" wrote:


Worksheets("Open Red Tags").Range("J4")=format(now(),"MM/DD/YYYY")

"Mike K" wrote:

Oh Wise Ones,
We have a disposition file that records a date the
entry was made among other things. I would like to add the time to that
stamp. I know this is simple for you programmers but I need help with the
syntax.

Current code:

Worksheets("Open Red Tags").Range("J4") = Date

I would like to add the date AND time to J4, but preferably keep the
formatting to display only the date (M/D/YYYY) . Could someone please help?

Thanks,
Mike


Mike K

Placing time with date
 
Beautiful!!

Thanks Sam

"Sam Wilson" wrote:


Sorry, use this:

With worksheets("Open Red Tags").Range("J4")
.Value = Now()
.NumberFormat = "MM/DD/YYYY"
End With

"Mike K" wrote:

Sam,
Pardon my ignorance but how do I place this to refer to the proper
sheet?
The previous line is:

Worksheets("Red Tag").Range("H20,H46") = Date

which is ok, but then I need to refer to another sheet

Worksheets("Open Red Tags").Range ("J4")= Date

and replace it with this:

Worksheets ("Open Red Tags")
With Range("J4")
.Value = Now()
.NumberFormat = "MM/DD/YYYY"
End With

I get an invalid use of property error.

Mike

"Sam Wilson" wrote:

Actually you need

with range("J4")
.value = now()
.numberformat="MM/DD/YYYY"
end with

"Sam Wilson" wrote:


Worksheets("Open Red Tags").Range("J4")=format(now(),"MM/DD/YYYY")

"Mike K" wrote:

Oh Wise Ones,
We have a disposition file that records a date the
entry was made among other things. I would like to add the time to that
stamp. I know this is simple for you programmers but I need help with the
syntax.

Current code:

Worksheets("Open Red Tags").Range("J4") = Date

I would like to add the date AND time to J4, but preferably keep the
formatting to display only the date (M/D/YYYY) . Could someone please help?

Thanks,
Mike



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

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