Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Use Calendar to insert dates in a form

Hi

Im pretty new in VBA, but have managed to create the Calender following the
information given in http://www.fontstuff.com/vba/vbatut07.htm (put in
private). Now i would like to use this calendar for editing a date in a form
(Deadline) when I doubleclick on the deadline field in the form. This issue
is that I can't figure out how to get the calendar to initially show the
value currently in the Deadline field and update the field with the date
selected in the calendar tool. Any help out there would be much appriciated.

Below a stup of the code to ligten up the Calendar Tool:

Private Sub txtDeadline_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Cancel = True
'Call OpenCalendar
Application.Run "Personal.xls!OpenCalendar"
End Sub

/Stony

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Use Calendar to insert dates in a form

It appears you have the calendar in Personal.xls. Look at the code for
UserForm_Initialize where the calendar is located. It is using the
activecell to get and put the calendar date. Since you are using a userform
in another workbook, you would need to change the reference to activecell to
ActiveWorkbook.UserForm1.TxtBox1.value, etc. which means the calendar would
only work for workbooks that have that exact same userform/textbox
configuration. I know you went to a lot of work to get the calendar in your
Personal.xls workbook, but in this case it would be better to put a calendar
in the book you are using so you can put in references that are specific to
that workbook, insted of modifying your Personal calendar code to work in
one particular workbook. Once you get a calendar added to your workbook, we
can help with the code from there.

Mike F
"Steen" wrote in message
...
Hi

Im pretty new in VBA, but have managed to create the Calender following
the
information given in http://www.fontstuff.com/vba/vbatut07.htm (put in
private). Now i would like to use this calendar for editing a date in a
form
(Deadline) when I doubleclick on the deadline field in the form. This
issue
is that I can't figure out how to get the calendar to initially show the
value currently in the Deadline field and update the field with the date
selected in the calendar tool. Any help out there would be much
appriciated.

Below a stup of the code to ligten up the Calendar Tool:

Private Sub txtDeadline_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Cancel = True
'Call OpenCalendar
Application.Run "Personal.xls!OpenCalendar"
End Sub

/Stony



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Use Calendar to insert dates in a form

Hi Mike

Thanks for your answer - and yes I think you are right. I will try this
during the Cristmas Holidays and get back to you. :-)

"Mike Fogleman" wrote:

It appears you have the calendar in Personal.xls. Look at the code for
UserForm_Initialize where the calendar is located. It is using the
activecell to get and put the calendar date. Since you are using a userform
in another workbook, you would need to change the reference to activecell to
ActiveWorkbook.UserForm1.TxtBox1.value, etc. which means the calendar would
only work for workbooks that have that exact same userform/textbox
configuration. I know you went to a lot of work to get the calendar in your
Personal.xls workbook, but in this case it would be better to put a calendar
in the book you are using so you can put in references that are specific to
that workbook, insted of modifying your Personal calendar code to work in
one particular workbook. Once you get a calendar added to your workbook, we
can help with the code from there.

Mike F
"Steen" wrote in message
...
Hi

Im pretty new in VBA, but have managed to create the Calender following
the
information given in http://www.fontstuff.com/vba/vbatut07.htm (put in
private). Now i would like to use this calendar for editing a date in a
form
(Deadline) when I doubleclick on the deadline field in the form. This
issue
is that I can't figure out how to get the calendar to initially show the
value currently in the Deadline field and update the field with the date
selected in the calendar tool. Any help out there would be much
appriciated.

Below a stup of the code to ligten up the Calendar Tool:

Private Sub txtDeadline_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Cancel = True
'Call OpenCalendar
Application.Run "Personal.xls!OpenCalendar"
End Sub

/Stony




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 do i insert an interactive calendar in an excel form Maria[_3_] Setting up and Configuration of Excel 2 April 26th 09 01:54 PM
How can I insert a date with an icon (calendar) insert Alfredo Mederico[_2_] Excel Discussion (Misc queries) 4 September 21st 07 01:20 AM
pull down calendar to insert dates & times R Dunn Excel Discussion (Misc queries) 2 January 10th 07 01:32 AM
Calendar to insert dates in a form Steen Excel Programming 6 November 26th 06 10:52 AM
How to insert a calendar to choose dates- JoeMa Excel Discussion (Misc queries) 2 April 7th 06 04:55 PM


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