Calendar

wzel

New Member
Joined
May 5, 2002
Messages
9
Is it possible to format a cell so that when it is clicked on, a drop down calendar displays and you can choose the date from the calendar to enter into the cell? If so, could someone describe the procedure. Thank You.
 
This is for dwhj... or anyone else

A Double click anywhere on the workseet will activate this control, but the result is always returned to A1. The line that does this is:

ActiveSheet.Range("A1") = Calendar1.Value



How can I change this to return the value to the selected cell, the one that was double clicked in the first place.

Rocky...
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
On 2002-05-07 06:48, Rocky E wrote:
This is for dwhj... or anyone else

A Double click anywhere on the workseet will activate this control, but the result is always returned to A1. The line that does this is:

ActiveSheet.Range("A1") = Calendar1.Value



How can I change this to return the value to the selected cell, the one that was double clicked in the first place.

Rocky...


There was an error in my first posting that I corrected in the second post.
Change the BeforeDoubleClick procedure to :-

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address = "$A$1" Then
UserForm1.Show
Application.EnableEvents = False
Target.Offset(1, 0).Select
Application.EnableEvents = True
End If
End Sub

With the revised code from the first posting, the calendar will appear when A1 is selected or double clicked, and the date selected will be put in A1.

The code in the second post will display the calendar when a cell in column B is double-clicked, and the date selected will be put in the active cell.

If you need the calendar activated under some other conditions, the code needs to be adjusted accordingly. Post again if you have difficulty in changing the code.
 
Upvote 0
Well no I got that, but the button routine that actualy returns the value to "A1" every time.

Private Sub CommandButton1_Click()
ActiveSheet.Range("A1") = Calendar1.Value
Me.Hide
End Sub

I need to pass the range from the other routine here (I think).

Thanks for hanging with me!!!

Rocky...
 
Upvote 0
Try:

Code:
activesheet.selection = Calendar1.Value

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
wave.gif

This message was edited by NateO on 2002-05-07 19:33
 
Upvote 0
On 2002-05-07 18:50, Rocky E wrote:
Well no I got that, but the button routine that actualy returns the value to "A1" every time.

Private Sub CommandButton1_Click()
ActiveSheet.Range("A1") = Calendar1.Value
Me.Hide
End Sub

I need to pass the range from the other routine here (I think).

Thanks for hanging with me!!!

Rocky...

Not if you use the code in my second post, as I advised you to do. Which is :-

Private Sub CommandButton1_Click()
ActiveCell = Calendar1.Value
Me.Hide
End Sub
 
Upvote 0
Hi:

I have it working but it always gives me the same date no matter how I change it. May 2002 is what I get.

Thanks

Orlando
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,309
Members
449,095
Latest member
Chestertim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top