View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_5_] Stuart[_5_] is offline
external usenet poster
 
Posts: 413
Default Listbox and Array questions

Actually, that's a good point, and both are relevent!
I guess the ideal wold be:
a:
only load lb.col2 if the textbox value is valid
AND is a unique value to lb.col2
b:
then after each 'a:' test if lb.col2 is full (ie contains
a value for each lb.col1 value) AND then enable
the OkButton.

It's referencing col2 in the listbox that's my first
problem.

Regards and thanks.

"James S" wrote in message
...
Hi Stuart,

Just checking. Are you trying to make sure the user does
not enter a value that already exists in the ListBox? Or
are you trying to disable/enable the OK button depending
on what the user has entered into the TextBox? Just trying
to get a clearer picture of what you need.

Thanks,
James S

-----Original Message-----
With a 2 column listbox, user is able to input values
to column 2 via a text box. How may I test that all
entries in col 2 have been made before the
OkButton_Click enables them to leave the form, please?

I am struggling to understand the basics of arrays, and
know that it is important to do so.
Here is very inefficient working code which I'm sure is
ideally suited to arrays:

For Each Cell In .Range("G1:G250")
For Each c In .Range("A1:A250")
If Cell.Value = c.Value Then
Cell.Offset(0, 1).Value = c.Offset(0, 1).Value
End If
Next
Next

I would be very grateful for help with this particular
situation, and also any links to primers on arrays.

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