Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default floor and rounding

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   Report Post  
Posted to microsoft.public.excel.programming
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)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default floor and rounding

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default floor and rounding

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FLOOR FUNCTION Confused Excel Discussion (Misc queries) 5 November 11th 09 03:24 AM
More function than FLOOR() ! wilchong via OfficeKB.com New Users to Excel 12 August 6th 08 12:47 AM
floor function srroduin Excel Worksheet Functions 2 May 12th 06 10:11 PM
Something like CEILING or FLOOR gusvenables Excel Worksheet Functions 3 October 28th 05 04:09 AM
ceiling & floor Bill Ridgeway New Users to Excel 1 August 7th 05 02:32 PM


All times are GMT +1. The time now is 11:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"