Calendar staying open

J

John

Hi Everyone
I'm using a Calendar to set dates on my form (worksheet)
I have to select the cell first before opening the calendar.
Question: Is it possible to have it open then select the cell.
If Yes is it possible that it stays open and install more then one date.
Using XL03 and my code below:

Private Sub UserForm_Initialize()
' Check if active cell contains a date. If 'yes' show
' same date on calendar. If 'no' show today's date.
If IsDate(ActiveCell.Value) Then
Calendar1.Value = DateValue(ActiveCell.Value)
Else
Calendar1.Value = Date
End If
End Sub

Private Sub Calendar1_Click()
' Transfer date selected on calendar to active cell
' and close UserForm.
ActiveCell.Value = Calendar1.Value
Unload Me
End Sub
 
J

John

Hi Joel
I have a small problem I can't fix.
If I press the Cancel button on the "Inputbox", I get an error 13 Type mismatch.
I tried different error handling but no success.
Hope you can still help me
Regards
John
 
J

John

Hi Joel
I found Refedit and got it in the Reference list."Thanks"
You wrote this>Then use the RefEdit control to like a
regular userform t get the cell address ( I don't understand)
Sorry but I'm new to this and don't know what to do next.
Can you help me out
Regards
John
joel said:
I think you may have to put a RefEdit control on a userform. If the
control is not on the userform toolbox then right click the toolbox and
select additional controls. If RefEdit is not on the list then Do the
following

VBA menu - References - RefEdit

If it is not in the lsit the "browse" for the DLL here Refedit.dll

C:\Program Files\Microsoft Office\Office11 (or latest version of
office)


Sometimes yo have the RefEdit already installed but it is not pointing
to the correct location. go back to Reference menu and browse even
though it is in the list. Then use the RefEdit control to like a
regular userform t get the cell address.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=165975

Microsoft Office Help
 
J

John

Hi Joel
Thank you for your patient.
RefEdit is on my Toolbox, you say to put it on the Userform,I can't, it won't
go.
With your code I get a Compile error.
Hope you still have patience with me
Regards
John
 
J

John

It looks like VBA won't recognize RefEdit, because I have other userforms and
different control but no Inputbox.
I can live with the problem, no big deal, but one last try, can we hide the
Cancel button.
Best wishes for the New Year.
John
 
J

John

Hi Joel
I thought you would like to know I got it to work.
On my Toolbox Control, I right click "Additional Controls" got
a Refedit Control, put in on my UserForm and your code and Voilà.
It's working.
If you don't use it properly it bugs but that's ok
Thanks again
Regards
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top