still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 826
- Office Version
- 365
- Platform
- Windows
Hi
I'm using the following code to put the time in a cell:
Even though I have the NumberFormat as "h:mm AM/PM" I still get the date and seconds in the cell as well.
How do I chage the code to only get the Hour and Minutes?
Thanks
Mike
I'm using the following code to put the time in a cell:
HTML:
Sub time()
ActiveCell.Select
ActiveCell.FormulaR1C1 = "=now()"
Selection.NumberFormat = "h:mm AM/PM"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
How do I chage the code to only get the Hour and Minutes?
Thanks
Mike