That last one I sent doesn't work, but you can put =NOW()
in one cell, recalculate, copy, paste values in two cells,
with one formatted as date, and the other formatted as
time.
If you're just pasting values, the destination cells will
hold their formatting.
-----Original Message-----
Very cool--you know, even though it's such a small
routine, I could never
have come up with it. Thanks a lot! I wonder--is it
possible to have the
macro return the time so that it isn't in military time,
but uses an "AM" or
"PM" indicator instead? (And I can't tell--is there one
space bar space
between the date and time so that it conforms with Excel
date/time format
and can be used for calculations?) The folks who will use
this could of
course do the calculation themselves, but I want the info
to be as quickly
absorbed as possible.
Again--very cool. Thank you so much!
-----Original Message-----
Sub DateAndTime()
With ActiveCell
.Value = Now
.NumberFormat = "dd mm yyyy hh:mm:ss"
End With
End Sub
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Michael Link" wrote in
message
...
I guess this is part 2 of a query I started below. I
need a macro that will
enter both the current date and time into the active
cell whenever it is
run.
Since this is for a workbook shared across a network,
the information
needs
to remain unchanged in the cell even if the macro is run
for another active
cell by someone else on the network.
Help! I've recorded or written very few macros, and
unfortunately I need to
have this one running as soon as possible. Thanks in
advance for your
help,
and thanks to the folks who offered assistance to a
related date/time
query
earlier today.
.
.
|