Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is my (not working) attempt to only enable
the OKButton if all entries in col2 of the listbox are filled with text values More correctly, if there is a value in col1, then there should be some value against it in col2. Private Sub OKButton_Click() Dim i As Integer, missing As Integer lbDataCode.BoundColumn = 2 missing = 0 For i = 0 To lbDataCode.ListCount - 1 If lbDataCode.Value = "" Then missing = missing + 1 End If Next If missing 0 Then 'more values are required MsgBox ("You must complete all Fields _ in Column 2, before you exit.") OKButton.Enabled = False Else OKButton.Tag = "Selected" CancelButton.Tag = "" Me.Hide End If lbDataCode.BoundColumn = 1 End Sub How do I test for 'empty' values, please? Regards. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub OKButton_Click()
Dim i As Integer, missing As Integer 'lbDataCode.BoundColumn = 2 missing = 0 For i = 0 To lbDataCode.ListCount - 1 If lbDataCode.List(i,0) < "" and _ Trim(lbDataCode.List(i,1))="" then missing = missing + 1 End If Next If missing 0 Then 'more values are required MsgBox ("You must complete all Fields _ in Column 2, before you exit.") OKButton.Enabled = False Else OKButton.Tag = "Selected" CancelButton.Tag = "" Me.Hide End If 'lbDataCode.BoundColumn = 1 End Sub -- Regards, Tom Ogilvy "Stuart" wrote in message ... Here is my (not working) attempt to only enable the OKButton if all entries in col2 of the listbox are filled with text values More correctly, if there is a value in col1, then there should be some value against it in col2. Private Sub OKButton_Click() Dim i As Integer, missing As Integer lbDataCode.BoundColumn = 2 missing = 0 For i = 0 To lbDataCode.ListCount - 1 If lbDataCode.Value = "" Then missing = missing + 1 End If Next If missing 0 Then 'more values are required MsgBox ("You must complete all Fields _ in Column 2, before you exit.") OKButton.Enabled = False Else OKButton.Tag = "Selected" CancelButton.Tag = "" Me.Hide End If lbDataCode.BoundColumn = 1 End Sub How do I test for 'empty' values, please? Regards. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks for that.
Regards. "Tom Ogilvy" wrote in message ... Private Sub OKButton_Click() Dim i As Integer, missing As Integer 'lbDataCode.BoundColumn = 2 missing = 0 For i = 0 To lbDataCode.ListCount - 1 If lbDataCode.List(i,0) < "" and _ Trim(lbDataCode.List(i,1))="" then missing = missing + 1 End If Next If missing 0 Then 'more values are required MsgBox ("You must complete all Fields _ in Column 2, before you exit.") OKButton.Enabled = False Else OKButton.Tag = "Selected" CancelButton.Tag = "" Me.Hide End If 'lbDataCode.BoundColumn = 1 End Sub -- Regards, Tom Ogilvy "Stuart" wrote in message ... Here is my (not working) attempt to only enable the OKButton if all entries in col2 of the listbox are filled with text values More correctly, if there is a value in col1, then there should be some value against it in col2. Private Sub OKButton_Click() Dim i As Integer, missing As Integer lbDataCode.BoundColumn = 2 missing = 0 For i = 0 To lbDataCode.ListCount - 1 If lbDataCode.Value = "" Then missing = missing + 1 End If Next If missing 0 Then 'more values are required MsgBox ("You must complete all Fields _ in Column 2, before you exit.") OKButton.Enabled = False Else OKButton.Tag = "Selected" CancelButton.Tag = "" Me.Hide End If lbDataCode.BoundColumn = 1 End Sub How do I test for 'empty' values, please? Regards. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Check Spreadsheet entries against a list | Excel Discussion (Misc queries) | |||
How to check previous entries in column for same contents | Excel Worksheet Functions | |||
how can I check a worksheet for duplicate entries or numbers? | Excel Worksheet Functions | |||
Check for double entries in a row | Excel Worksheet Functions | |||
Check for duplicate entries | Excel Programming |