View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
peter peter is offline
external usenet poster
 
Posts: 29
Default floor and rounding

Hi,
try this...
sasstart = Now
sasstartround = Hour(sasstart) & ":" &
Application.WorksheetFunction.Floor(Minute(sasstar t), 1)
SASStartClock = DateAdd("h", 1, sasstartround)


"srroduin" wrote:

I thought I had it after reading all of the other posts and links.

The user will put in a date and time in the input box. I need to round any
minutes down to the previous hour. Finally I need to add 1 hour to that
time. What am I doing wrong?

I went into tools references and added atpvbaen. Everytime I run it it says
function or sub not defined and floor is highlighted. Help!!!

So far I have this:

SASStart = InputBox("Enter start date mm/dd/yyyy hh:mm of event, USE CLOCK
TIME")

SASStartRound = Time(Hour(SASStart), Floor(Minute(SASStart), 1), 0)

SASStartClock = DateAdd("h", 1, SASStartRound)