Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA - Userform Checkbox/Textbox Problem

I'm creating a Userform which includes manufacture dates and shelf
life.
I have a Checkbox and a Textbox that I would like to have work
together.
I would like the Checkbox unchecked on startup and the associated
Textbox to be disabled unless the Checkbox is checked.

The code currently reads:
Private Sub chkExtension_Change()
If chkExtension = True Then
ActiveCell.Offset(0, 15).Value = "Yes"
Else
ActiveCell.Offset(0, 15).Value = "NO"

End If

If chkExtension = True Then
txtExtDate.Enabled = True
Else
chkExtension.Enabled = False
txtExtDate.Enabled = False
End If
End Sub


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel VBA - Userform Checkbox/Textbox Problem

Thunder,

Try this

Private Sub chkExtension_Click()
If chkExtension.Value = True Then
txtExtDate.Enabled = True
Else
txtExtDate.Enabled = False
End If
End Sub

Private Sub UserForm_Activate()
txtExtDate.Enabled = False
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Thunder5 " wrote in message
...
I'm creating a Userform which includes manufacture dates and shelf
life.
I have a Checkbox and a Textbox that I would like to have work
together.
I would like the Checkbox unchecked on startup and the associated
Textbox to be disabled unless the Checkbox is checked.

The code currently reads:
Private Sub chkExtension_Change()
If chkExtension = True Then
ActiveCell.Offset(0, 15).Value = "Yes"
Else
ActiveCell.Offset(0, 15).Value = "NO"

End If

If chkExtension = True Then
txtExtDate.Enabled = True
Else
chkExtension.Enabled = False
txtExtDate.Enabled = False
End If
End Sub


---
Message posted from http://www.ExcelForum.com/



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 format a textbox on a userform created in excel Bert New Users to Excel 1 May 5th 08 11:46 PM
Action Event, CheckBox, Add Row and Textbox Ryan Excel Discussion (Misc queries) 2 July 17th 07 02:32 PM
Userform and checkbox.... Ben.c Excel Programming 3 December 19th 03 05:56 PM
Userform Textbox - Date Problem universal[_6_] Excel Programming 2 November 26th 03 04:31 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 01:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"