My original post was as follows (modified below to use the Format
function), the version without the use of With was to get it on one line,
but as Rick pointed out that was longer in character count than his three
liner, well the following is only 127 characters and maybe is the shortest
code possible??
With ActiveSheet
.Name = .Cells(.Rows.Count, 1).End(xlUp) & _
Format(.Cells(.Rows.Count, 5).End(xlUp),"m-d-yy h-mmAM/PM")
End With
It is not shorter than my code (as long as you squeeze out the blank spaces
that you don't have to type in because VBA will inserts them automatically).
I also added the separating space between concatenation of the the two cell
contents to your code that the OP indicated she wanted (which I did by
simply adding a space to the beginning of the pattern string in the Format
function call). When these both have been done, your code counts 5
characters longer than mine... and that is with my leaving in the .Value
property call in my code (you left it out of your code because it is the
default property for your Cells object "chain" in the first part of your
code). I personally do not like relying on default object properties in
code; but if I remove that from my code, your code is 11 characters longer
than mine.
Sorry Rick but this will not run on you TI 99/4 or a Sinclair Z81 !!
LOL... no, almost nothing we write today could run on them. By the way, one
of the computers I had across the years (and there were many) was a Timex
computer which was the US version of the Sinclair, although I came by it
rather late... my mother when to a time-share meeting of some sort and the
Timex was one of the give-away inducement gifts the sponsors gave for
attending... my mother got it for my son who was too young to use it at the
time and, by the time he grew up enough to make use of a computer, that one
was long out-of-favor (my mother was not too up on technology in those
days)... I still have that computer (in the original box) up in a closet
somewhere.
Rick