If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Calander
Let me rephrase my Calander question.
Does anyone know how to copy the date clicked on the calender to a cell? Example: In Excel VB, I inserted a calander (MonthView) into a form. (Its not a typical object, I right-clicked on the Object toolbox, and chose "Additional Controls", from which I chose "Microsoft MonthView Control 6.0 (SP4)". This allowed me to insert a changeable calender into a form, callable from a worksheet. Question is: After clicking a desired date, how do I copy that date to my worksheet??? Anyone? |
#2
|
|||
|
|||
Calander
I'm assuming you placed a calendar control on a worksheet rather than having
one on a UserForm. That being said, do the following. In design mode, right-click on the calendar control and select View Code. The Visual Basic Editor will pop up. You will see two lines as follows: Private Sub Calendar1_Click() End Sub If, for example, you want the selected date to appear in cell A1, then you would insert the following between those two lines: Range("A1").Value = Calendar1.Value This is assuming your calendar is named Calendar1. You can check this by right-clicking on the calendar control and selecting Properties. The name of the control will be at the top of the Properties box that pops up. HTH Mike. -- Michael J. Malinsky "John Mansship" wrote in message ... Let me rephrase my Calander question. Does anyone know how to copy the date clicked on the calender to a cell? Example: In Excel VB, I inserted a calander (MonthView) into a form. (Its not a typical object, I right-clicked on the Object toolbox, and chose "Additional Controls", from which I chose "Microsoft MonthView Control 6.0 (SP4)". This allowed me to insert a changeable calender into a form, callable from a worksheet. Question is: After clicking a desired date, how do I copy that date to my worksheet??? Anyone? |
#3
|
|||
|
|||
Calander
many thanks, Michael.
Actually, I am putting it into a userform so that I can call it when I wish. But your answer is applicable for both cases. Thanks again!! -----Original Message----- I'm assuming you placed a calendar control on a worksheet rather than having one on a UserForm. That being said, do the following. In design mode, right-click on the calendar control and select View Code. The Visual Basic Editor will pop up. You will see two lines as follows: Private Sub Calendar1_Click() End Sub If, for example, you want the selected date to appear in cell A1, then you would insert the following between those two lines: Range("A1").Value = Calendar1.Value This is assuming your calendar is named Calendar1. You can check this by right-clicking on the calendar control and selecting Properties. The name of the control will be at the top of the Properties box that pops up. HTH Mike. -- Michael J. Malinsky "John Mansship" wrote in message ... Let me rephrase my Calander question. Does anyone know how to copy the date clicked on the calender to a cell? Example: In Excel VB, I inserted a calander (MonthView) into a form. (Its not a typical object, I right-clicked on the Object toolbox, and chose "Additional Controls", from which I chose "Microsoft MonthView Control 6.0 (SP4)". This allowed me to insert a changeable calender into a form, callable from a worksheet. Question is: After clicking a desired date, how do I copy that date to my worksheet??? Anyone? . |
Thread Tools | |
Display Modes | |
|
|