Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have two date boxes on a user form, txtDate and txt Due. Both have
check boxes that are default "false." I would like the txtDue to become "true" when I check txtDate and automatically assume the same date as txtDate. How do I accomplish this? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
By coding your check box1 ... Private Sub CheckBox1_Click() CheckBox2.Enabled = True CheckBox2.Value = CheckBox1.Value End Sub be sure to adjust with your names ... HTH Carim |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Why not set the value property of the second box to try as part of the change method of the first. -- mrice ------------------------------------------------------------------------ mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931 View this thread: http://www.excelforum.com/showthread...hreadid=532743 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Carim's method works, but it only enables txtDue when I click
txtDate. I actually want txtDue to stay disabled until I click it, I just want it's value to change to the value in txtDate when I enable it. (I dont always use a Due Date, but if I do it is generally the next day or two, so it is easier to start from the Date.)(If that is clearer than mud.) I don't know how to follow mrice's advice. I tried to set the value in txtDue to "txtDate" and get an error message. (???) I appreciate your help. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if txtDate and txtDue are checkboxes and txtDue has the enabled property set
to false when the userform is shown. then you want to click one the area of the disabled checkbox and have it come to life and take on the value of the checkbox txtDate, then you can use this: Private Sub UserForm_MouseDown(ByVal Button _ As Integer, ByVal Shift As Integer, _ ByVal X As Single, ByVal Y As Single) With txtDue If Y = .Top And Y <= .Top + .Height Then If X = .Left And X <= .Left + .Width Then .Enabled = True .Value = txtDate.Value End If Else End If End With End Sub -- Regards, Tom Ogilvy "L Scholes" wrote: Carim's method works, but it only enables txtDue when I click txtDate. I actually want txtDue to stay disabled until I click it, I just want it's value to change to the value in txtDate when I enable it. (I dont always use a Due Date, but if I do it is generally the next day or two, so it is easier to start from the Date.)(If that is clearer than mud.) I don't know how to follow mrice's advice. I tried to set the value in txtDue to "txtDate" and get an error message. (???) I appreciate your help. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want both to be disabled when the userform is initally activated in
case I dont need the dates. I will have to enter a date, but not always a due date, so I want them to activate independantly, but when I activate txtDue, I want it to assume the same date as txtDate instead of todays date. Not critical, but because the due date is always close to the date it will be faster to start from the date instead of today. I would try to use your method, but I'm not even sure where in my current code to place it; I am trying now, after posting this. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This I think is what you're wanting. If not let me know. Private Sub CheckBox1_Click() If CheckBox1.Value = True Then CheckBox2.Value = True textbox2.Value = textbox1.Value Else: CheckBox2.Value = False textbox2.Value = Date End If End Sub Adjust the names to your's and put the code under the checkbox tha you're wanting to activate -- dok11 ----------------------------------------------------------------------- dok112's Profile: http://www.excelforum.com/member.php...fo&userid=1058 View this thread: http://www.excelforum.com/showthread.php?threadid=53274 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clarification - how to automatically update cells with a date and date range | Excel Discussion (Misc queries) | |||
Automatically update a cell with a date based on anther cells date | Excel Discussion (Misc queries) | |||
input a date or update it based on date in another cell | New Users to Excel | |||
How to update a cell if a specific date is included in a date rang | Setting up and Configuration of Excel | |||
Date update on data update | Excel Programming |