storm said:
I am but a poor novice working on an iMac.
CMD- gives me the date
CMD; gives me the time
CMD-; gives me a literal I can not use
One convention for writing key combinations is to use a hyphen to
separate the keys. So I meant CMD-; to be the semicolon key while
holding down CMD.
On the Macro which I created using "record new Macro", (1) those steps
gave me a time stamp but activating the Macro did not, (2) I went back
and edited the Macro to change E32 to D32 as you suggested but that
gave the same result as before.
I wasn't suggesting changing E32 to D32. I was saying that the selection
was the cause of your problem - if you didn't want to use my
alternative, you should take out both the
Range("D32").Select
and the
Range("E32").Select
statements.
I assume "XL function" means Macro.
No it means Excel Function. For instance =NOW().
I don't know what VBA is, nor
understand what you mean by using the "Time method".
Visual Basic for Applications (VBA) is the language that macros are
written or recorded in. Your recorded macro is an example of VBA.
VERY roughly - commands in VBA that return values are called methods.
So what I was suggesting is that instead of inserting the Excel Function
NOW() into the cell, then copying and paste special-ing, that it was
easier to insert the value from VBA's built-in Time function/method.
That doesn't mean your approach was wrong (except for changing the
selected cell in the middle). There are almost always multiple ways to
accomplish a process in XL & VBA.
I guess you must think I am stupid
Nope - just ignorant about VBA. Ignorant's a lot better than stupid -
I'm ignorant about nearly everything. VBA just happens to be one of the
things I know something about.
but all I want to do is have a
simple way of time stamping a cell.
And I still have no idea of how to do that.
Easiest: Type CMD and ; keys
If you want to record seconds, or a particular format, paste this macro
into a regular code module in your Personal Macro Workbook:
Public Sub TimeStamp()
With ActiveCell
.Value = Time
.NumberFormat = "[hh]:mm:ss"
End With
End Sub
(or substitute your favorite time format).
For more on where to put your code, see
http://www.mcgimpsey.com/excel/modules.html
and
http://www.mvps.org/dmcritchie/excel/getstarted.htm
(gives examples for WinXL - substitute MacXL's "Personal Macro Workbook"
for the references to WinXL's "Personal.xls")