Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm finally able to try this again now that I have the rest of my code working.
When I did this it didn't change anything. The SASStart value is typed in by the user and is used throughout the code so I didn't make it = to now. For example 5/10/2006 08:14 stayed the same. ANY IDEAS???? Thanks for you help! "peter" wrote: 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) |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
It's not the "now" that matters. Any time will do. Take a look at the application.worksheetfunction in order to get floor to work. peter "srroduin" wrote: I'm finally able to try this again now that I have the rest of my code working. When I did this it didn't change anything. The SASStart value is typed in by the user and is used throughout the code so I didn't make it = to now. For example 5/10/2006 08:14 stayed the same. ANY IDEAS???? Thanks for you help! "peter" wrote: 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) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FLOOR FUNCTION | Excel Discussion (Misc queries) | |||
More function than FLOOR() ! | New Users to Excel | |||
floor function | Excel Worksheet Functions | |||
Something like CEILING or FLOOR | Excel Worksheet Functions | |||
ceiling & floor | New Users to Excel |