Increase the date/time in a excel table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear excel users,

I have a question.

If have a worksheet with dates (my regional setting are e.g. 21-3-2006
15:00). I would like to be able to select a cell and then click on a button
so I can increase the cell with for example 1 hour so I would get 21-3-2006
16:00.

Any advise for me would be great because I am stuck.

thnks and krgds,

RMF
 
One way:

Put a Forms toolbar button on the sheet. Attach this macro:

Public Sub AddHour_Click()
If TypeOf Selection Is Range Then
With ActiveCell
If IsNumeric(ActiveCell.Value) Then _
.Value = .Value + 1 / 24
End With
End If
End Sub
 

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

Back
Top