Time Now() minus ten minutes

S

Sabosis

Hello-

I am trying to get the current time less ten minutes to calculate in a cell. I need the time only, no date so I was told to use the MOD portion in the formula below.

ActiveCell.FormulaR1C1 = "=MOD(NOW()- Timeserial(0,10,0)"

If it is 5:37 AM, I want 5:27 AM reported with now date in the field.

Thanks

Scott
 
C

Claus Busch

Hi Scott,

Am Mon, 14 Jan 2013 06:00:11 -0800 (PST) schrieb Sabosis:
I am trying to get the current time less ten minutes to calculate in a cell. I need the time only, no date so I was told to use the MOD portion in the formula below.

ActiveCell.FormulaR1C1 = "=MOD(NOW()- Timeserial(0,10,0)"

If it is 5:37 AM, I want 5:27 AM reported with now date in the field.

format the cell "h:mm AM/PM"
or do it in VBA:

With ActiveCell
.Formula = "=NOW()-TIME(0,10,0)"
.NumberFormat = "h:mm AM/PM"
End With


Regards
Claus Busch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top