Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
NFL NFL is offline
external usenet poster
 
Posts: 31
Default Creating a List using a Form

It's my understanding that you can not expand a list using a drop-down menu
using data validation.


The list I like to show on the form is cell range E1:E90 (all in one column).

I looked at Microsofts help menu and tried to follow the pattern and its not
working.

Private Sub ListBox1_Click()

Sheets("Sheet1").Select
ListBox1.ColumnCount = 1
ListBox1.RowSource = "e81:e90"


ListBox1.ControlSource = "E5"
'Place the ListIndex into cell a6
ListBox1.BoundColumn = 0
End Sub

Thank you for your help!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Creating a List using a Form

See if the following examples help.

Private Sub ListBox1_AfterUpdate()
'Place the ListIndex into cell a6
Sheets("Sheet1").Range("A6") = ListBox1.ListIndex
End Sub

Private Sub ListBox1_Enter()
ListBox1.ColumnCount = 1
ListBox1.RowSource = "Sheet1!E81:E90"
ListBox1.ControlSource = "Sheet1!E5"
End Sub


--
Regards,

OssieMac


"NFL" wrote:

It's my understanding that you can not expand a list using a drop-down menu
using data validation.


The list I like to show on the form is cell range E1:E90 (all in one column).

I looked at Microsofts help menu and tried to follow the pattern and its not
working.

Private Sub ListBox1_Click()

Sheets("Sheet1").Select
ListBox1.ColumnCount = 1
ListBox1.RowSource = "e81:e90"


ListBox1.ControlSource = "E5"
'Place the ListIndex into cell a6
ListBox1.BoundColumn = 0
End Sub

Thank you for your help!

  #3   Report Post  
Posted to microsoft.public.excel.misc
NFL NFL is offline
external usenet poster
 
Posts: 31
Default Creating a List using a Form

That worked great except for one thing. I wanted the "selected" items to
appear in Cell E5, but all I get are numbers (0,1,2 ..etc.). . This is what
I entered on the command button. I don't know why I get numbers instead of
the items selected. Thank you again!!!

Private Sub CommandButton6_Click()
Sheets("Sheet1").Range("E5") = CSE_List.ListBox1.Value
CSE_List.Show
End Sub

Private Sub ListBox1_AfterUpdate()
'Place the ListIndex into cell E5
Sheets("Sheet1").Range("E5") = ListBox1.ListIndex
End Sub

Private Sub ListBox1_Enter()
ListBox1.ColumnCount = 1
ListBox1.RowSource = "Sheet1!E81:E90"
ListBox1.ControlSource = "Sheet1!E5"
End Sub

"OssieMac" wrote:

See if the following examples help.

Private Sub ListBox1_AfterUpdate()
'Place the ListIndex into cell a6
Sheets("Sheet1").Range("A6") = ListBox1.ListIndex
End Sub

Private Sub ListBox1_Enter()
ListBox1.ColumnCount = 1
ListBox1.RowSource = "Sheet1!E81:E90"
ListBox1.ControlSource = "Sheet1!E5"
End Sub


--
Regards,

OssieMac


"NFL" wrote:

It's my understanding that you can not expand a list using a drop-down menu
using data validation.


The list I like to show on the form is cell range E1:E90 (all in one column).

I looked at Microsofts help menu and tried to follow the pattern and its not
working.

Private Sub ListBox1_Click()

Sheets("Sheet1").Select
ListBox1.ColumnCount = 1
ListBox1.RowSource = "e81:e90"


ListBox1.ControlSource = "E5"
'Place the ListIndex into cell a6
ListBox1.BoundColumn = 0
End Sub

Thank you for your help!

  #4   Report Post  
Posted to microsoft.public.excel.misc
NFL NFL is offline
external usenet poster
 
Posts: 31
Default Creating a List using a Form

I got it figured out ... here's the code... Thank you again for your help!!!

Private Sub OKButton_Click()
Sheets("Sheet1").Range("E5") = Me.ListBox1.Value
CSE_List.Hide
End Sub

"OssieMac" wrote:

See if the following examples help.

Private Sub ListBox1_AfterUpdate()
'Place the ListIndex into cell a6
Sheets("Sheet1").Range("A6") = ListBox1.ListIndex
End Sub

Private Sub ListBox1_Enter()
ListBox1.ColumnCount = 1
ListBox1.RowSource = "Sheet1!E81:E90"
ListBox1.ControlSource = "Sheet1!E5"
End Sub


--
Regards,

OssieMac


"NFL" wrote:

It's my understanding that you can not expand a list using a drop-down menu
using data validation.


The list I like to show on the form is cell range E1:E90 (all in one column).

I looked at Microsofts help menu and tried to follow the pattern and its not
working.

Private Sub ListBox1_Click()

Sheets("Sheet1").Select
ListBox1.ColumnCount = 1
ListBox1.RowSource = "e81:e90"


ListBox1.ControlSource = "E5"
'Place the ListIndex into cell a6
ListBox1.BoundColumn = 0
End Sub

Thank you for your help!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Creating a List using a Form

Some more info that might help you to understand what is occurring. Your
original post had a comment 'Place the ListIndex into cell a6. The ListIndex
is the number of the location of the selection starting from zero as the
first value. This is what I did.

The following part of the code dynamically places the selected value in E5
without additional code to reference the value. It is like a linked cell to
the selected value.
ListBox1.ControlSource = "Sheet1!E5"

--
Regards,

OssieMac


"NFL" wrote:

I got it figured out ... here's the code... Thank you again for your help!!!

Private Sub OKButton_Click()
Sheets("Sheet1").Range("E5") = Me.ListBox1.Value
CSE_List.Hide
End Sub

"OssieMac" wrote:

See if the following examples help.

Private Sub ListBox1_AfterUpdate()
'Place the ListIndex into cell a6
Sheets("Sheet1").Range("A6") = ListBox1.ListIndex
End Sub

Private Sub ListBox1_Enter()
ListBox1.ColumnCount = 1
ListBox1.RowSource = "Sheet1!E81:E90"
ListBox1.ControlSource = "Sheet1!E5"
End Sub


--
Regards,

OssieMac


"NFL" wrote:

It's my understanding that you can not expand a list using a drop-down menu
using data validation.


The list I like to show on the form is cell range E1:E90 (all in one column).

I looked at Microsofts help menu and tried to follow the pattern and its not
working.

Private Sub ListBox1_Click()

Sheets("Sheet1").Select
ListBox1.ColumnCount = 1
ListBox1.RowSource = "e81:e90"


ListBox1.ControlSource = "E5"
'Place the ListIndex into cell a6
ListBox1.BoundColumn = 0
End Sub

Thank you for your help!



  #6   Report Post  
Posted to microsoft.public.excel.misc
NFL NFL is offline
external usenet poster
 
Posts: 31
Default Creating a List using a Form

Thank you for your response and exlanation. It helps a lot to see and
understand what is going on.

"OssieMac" wrote:

Some more info that might help you to understand what is occurring. Your
original post had a comment 'Place the ListIndex into cell a6. The ListIndex
is the number of the location of the selection starting from zero as the
first value. This is what I did.

The following part of the code dynamically places the selected value in E5
without additional code to reference the value. It is like a linked cell to
the selected value.
ListBox1.ControlSource = "Sheet1!E5"

--
Regards,

OssieMac


"NFL" wrote:

I got it figured out ... here's the code... Thank you again for your help!!!

Private Sub OKButton_Click()
Sheets("Sheet1").Range("E5") = Me.ListBox1.Value
CSE_List.Hide
End Sub

"OssieMac" wrote:

See if the following examples help.

Private Sub ListBox1_AfterUpdate()
'Place the ListIndex into cell a6
Sheets("Sheet1").Range("A6") = ListBox1.ListIndex
End Sub

Private Sub ListBox1_Enter()
ListBox1.ColumnCount = 1
ListBox1.RowSource = "Sheet1!E81:E90"
ListBox1.ControlSource = "Sheet1!E5"
End Sub


--
Regards,

OssieMac


"NFL" wrote:

It's my understanding that you can not expand a list using a drop-down menu
using data validation.


The list I like to show on the form is cell range E1:E90 (all in one column).

I looked at Microsofts help menu and tried to follow the pattern and its not
working.

Private Sub ListBox1_Click()

Sheets("Sheet1").Select
ListBox1.ColumnCount = 1
ListBox1.RowSource = "e81:e90"


ListBox1.ControlSource = "E5"
'Place the ListIndex into cell a6
ListBox1.BoundColumn = 0
End Sub

Thank you for your help!

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
Creating A Form Johnnie[_2_] Excel Worksheet Functions 2 June 30th 08 05:43 PM
Creating a Form Claudine Excel Worksheet Functions 2 December 5th 06 10:59 PM
Creating a form oakridge Excel Worksheet Functions 0 May 18th 06 01:22 PM
creating a form aprylddd New Users to Excel 1 September 20th 05 09:45 AM
Creating a Form Marcia3641 Excel Discussion (Misc queries) 10 July 21st 05 06:15 PM


All times are GMT +1. The time now is 05:54 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"