LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Check all lsitbox entries are filled

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


 
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
Check Spreadsheet entries against a list SarahJ Excel Discussion (Misc queries) 1 November 14th 08 04:43 PM
How to check previous entries in column for same contents Emily Excel Worksheet Functions 4 July 30th 08 10:56 PM
how can I check a worksheet for duplicate entries or numbers? RFI Excel Worksheet Functions 1 October 19th 05 04:08 AM
Check for double entries in a row Pierrot Robert Excel Worksheet Functions 1 September 5th 05 06:37 PM
Check for duplicate entries cstang Excel Programming 1 July 11th 03 08:02 PM


All times are GMT +1. The time now is 05:56 AM.

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"