Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Data validation - List Box

I have two questions for a list box. I have the code to put the list box in
thanks to this list. Now I need to do 2 things

1. Make sure typed in data is rejected unless the list box was used
2. Make sure the cursor is allways in Column "C" before entering the
contents of the list box.

I am purpously not unloading the list box as this is a shared workbook. I
seem to remember a way to auto run a macro on workbook open, but can't find
it in the help files. I know it was something simply like naming the macro
Automatic or something

CODE FOR "OK" Button

Private Sub cmdOK_Click()
Dim strnames As String
Dim x As Integer

For x = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(x) Then
strnames = strnames & ListBox1.List(x) & ", "
End If
Next x

If Not strnames = "" Then
strnames = Left(strnames, Len(strnames) - 1)
End If
ActiveCell.Value = strnames

ListBox1.RowSource = "MyList"

End Sub


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 get a Data validation list to select another validation l langston35 New Users to Excel 1 September 28th 09 08:38 AM
data validation list: how do i 'force' a user to enter data from the list? showsomeidnow Excel Discussion (Misc queries) 4 May 1st 07 05:49 PM
data validation list: how do i 'force' a user to enter data from the list? showsomeidnow Excel Discussion (Misc queries) 2 April 29th 07 11:09 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM


All times are GMT +1. The time now is 06:11 PM.

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

About Us

"It's about Microsoft Excel"