Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default time vs Day format

Have posted this in misc group, but think programming may have they
answer


HYCH.... I have the below code that calls a userform to be completed,
depending on the time.

ie, our night shift work from 21:00 to 06:00 and the below code
allows
me to call the userform mnpickfrm as long as the day in cell F2 is
shown as monday, but i am unable to pull this same form after
midnight,


i have the time being placed in q1, as a guide to whether 06:00 has
been passed, obviously the code below is not giving me the option to
pull back the mnpickfrm after midnight, can this be achieved with the
code below or am i missing something???


HYCH


Sub mnpick()


With Range("q1")
.Value = Time
End With
If Weekday(Worksheets("Load Input Sheet").Range("F2").Value) =
vbMonday Then
mnpickfrm.Show
Else
If Weekday(Worksheets("Load Input Sheet").Range("F2").Value) =
vbTuesday Then
Else
If (Worksheets("pick allocations").Range("q1").Value) <
"06:00:00"
Then
mnpickfrm.Show
Else
MsgBox "Incorrect Day Selected"
End If
End If
End If
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default time vs Day format

On Jun 6, 12:35 am, K1KKKA wrote:
Have posted this in misc group, but think programming may have they
answer

HYCH.... I have the below code that calls a userform to be completed,
depending on the time.

ie, our night shift work from 21:00 to 06:00 and the below code
allows
me to call the userform mnpickfrm as long as the day in cell F2 is
shown as monday, but i am unable to pull this same form after
midnight,

i have the time being placed in q1, as a guide to whether 06:00 has
been passed, obviously the code below is not giving me the option to
pull back the mnpickfrm after midnight, can this be achieved with the
code below or am i missing something???

HYCH

Sub mnpick()

With Range("q1")
.Value = Time
End With
If Weekday(Worksheets("Load Input Sheet").Range("F2").Value) =
vbMonday Then
mnpickfrm.Show
Else
If Weekday(Worksheets("Load Input Sheet").Range("F2").Value) =
vbTuesday Then
Else
If (Worksheets("pick allocations").Range("q1").Value) <
"06:00:00"
Then
mnpickfrm.Show
Else
MsgBox "Incorrect Day Selected"
End If
End If
End If
End Sub


Understand no one was able to answer this query, but have managed to
sort it out, with a bit of playing round.


Sub mnpick()

With Range("q1")
.Value = Time
End With
If Weekday(Worksheets("Load Input Sheet").Range("F2").Value) =
vbMonday Then
mnpickfrm.Show
Else
If Weekday(Worksheets("Load Input Sheet").Range("F2").Value) = vbTuesday Then
Else


If (Worksheets("pick allocations").Range("q1").Value) <= "06:00:00" {Found converting this figure to decimal (ie 06:00 = 0.25 worked), will now allow the userform to show only prior to 06:00 after this access is denied.}
Then


mnpickfrm.Show
Else
MsgBox "Incorrect Day Selected"
End If
End If
End If
End Sub




Thought i would share this as i was able to get it working, might be
of some use to someone later



Steve

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
How to format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 4 February 13th 09 04:34 PM
How to format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 1 February 13th 09 01:37 AM
How to format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 0 February 13th 09 12:49 AM
How to type format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 1 February 13th 09 12:09 AM
Remove time from a date and time field? Format removes the displa. oaoboc Excel Worksheet Functions 1 February 16th 05 07:20 PM


All times are GMT +1. The time now is 04:46 AM.

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

About Us

"It's about Microsoft Excel"