Dmcritchie.mvps.org
[pic]
| |
Sub UserForm_Activate()
Dim WS As Excel.Worksheet
ActiveSheet.Shapes("List Box 5").Select
With Selection
.ListFillRange = "C1:C12"
.LinkedCell = ""
.MultiSelect = xlNone
.Display3DShading = False
' .Clear
For Each WS In ActiveWorkbook.Worksheets
.AddItem WS.Name
Next WS
End With
End Sub
Sub listbox5_change()
End Sub
There are two listboxes. One from the forms toolbar (xl5 - xl2000) and one
from the Controls Toolbox Toolbar (xl97 - xl2000)
To refer to the latter
for each cell in Range("A1:A10")
worksheets("Sheet1").Listbox1.Additem cell.Value
Next
for a listbox on a worksheet it is probably easier to use the ListFillRange
property and assign it to a range
sheet1!A1:A10
If you want to change the name, right-click on it in design mode and select
properties. Change the first property: Name
For code, right-click on the sheet tab and select view code. In the left
dropdown f the module select the name of the listbox. In the right dropdown
select Click. Add the line in the center:
Private Sub Listbox1_click()
ActiveCell.Value = Listbox1.value
End sub
Regards,
Tom Ogilvy
MVP Excel
Dave Martin wrote in message
news:8p01mr$brr$1@slb6.atl....
> Can someone give me the syntax to get the text from a specific entry on a
> listbox?
--Answer:
sStr = Userform1.Listbox1.List(2)
2 is the third item since the list is zero based in an activeX control - if
from the forms toolbar, use 3.
if it is a multicolumn list activeX control:
sStr = Userform1.Listbox1.List(2,0) for the first column, 3rd row.
Regards,
Tom Ogilvy
MVP Excel
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- bcps org jobs
- smartcu org sign on page
- aarp org membership card registration
- free org email accounts
- hackensackumc org pay bill
- get my transcripts org from college
- bcps org community volunteer info
- my access tgh org portal
- bcps org employee self service
- intranet florida hospital org employee
- typical finance org chart
- org chart for finance department