#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Calendar

Hello
I have an application where I use a calendar on a userform (userform1).
Im trying to have the user select a date, type in information into an
inputbox and then get prompted again if they want to select another date,
but (as you probably know), when I click on the calendar to select another
date, the code runs again from the beginning.

How can I have it prompt the user "do you want to enter another date?" ; up
to a maximum of 5 times (when they select NO on the msgbox (vbNo), it should
exit the loop.

Thank you
Terry V


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Calendar

I did find "a" solution --- although many of you will agree; its not pretty:

Private Sub Calendar1_Click()
Dim dte As Date
Dim x As Integer
Dim msg As String
Dim results
Dim tme As String
Dim msg2 As String

dte = Me.ActiveControl
tme = InputBox("What time do you work?", "Input Hrs")
UserForm1.Hide
workinghrs = workinghrs & vbCrLf & dte & " " & tme
msg = "Do you want to enter another day?"
'UserForm1.Show
results = MsgBox(msg, vbYesNo)
If results = vbYes Then
UserForm1.Show
Else
msg2 = "Here are your hrs, please copy and paste them" & vbCrLf & workinghrs
MsgBox msg2
End If

End Sub

Thank you
Terry



"Terry V" wrote in message
...
Hello
I have an application where I use a calendar on a userform (userform1).
Im trying to have the user select a date, type in information into an
inputbox and then get prompted again if they want to select another date,
but (as you probably know), when I click on the calendar to select another
date, the code runs again from the beginning.

How can I have it prompt the user "do you want to enter another date?" ;

up
to a maximum of 5 times (when they select NO on the msgbox (vbNo), it

should
exit the loop.

Thank you
Terry V




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
Convert date from Gregorian Calendar to Hijri Calendar H.Alkhodary Excel Discussion (Misc queries) 1 February 21st 09 10:11 AM
find free sharware to include calendar pop or use calendar in cell ednc Excel Discussion (Misc queries) 2 April 14th 08 05:05 PM
how do i export excel calendar info to outlook calendar? Maggie Excel Discussion (Misc queries) 1 December 31st 07 10:27 PM
excel calendar - list of names displayed on calendar Brian'88 Excel Worksheet Functions 3 November 17th 06 10:31 PM
import calendar items from excel into outlook calendar jsewaiseh Excel Discussion (Misc queries) 0 September 2nd 05 03:53 PM


All times are GMT +1. The time now is 08:21 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"