View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
RK[_2_] RK[_2_] is offline
external usenet poster
 
Posts: 25
Default Frustrated - List Box

The listbox is empy. here is the code as I have it:


Private Sub CommandButton1_Click()

Unload Me

End Sub

Private Sub CommandButton2_Click()

Dim i As Long

For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) Then
'Range(Me.ListBox1.List(i)).Parent.PrintOut
Range(Me.ListBox1.List(i)).PrintOut
End If
Next i

End Sub

Private Sub frmUserForm1_Initialize()

Dim cell As Range

Me.ListBox1.ColumnCount = 2
Me.ListBox1.BoundColumn = 1
Me.ListBox1.ColumnWidths = "0;1"

For Each cell In Sheet1.Range("AC2:AC69").Cells
Me.ListBox1.AddItem cell.Hyperlinks(1).SubAddress
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) =
cell.Hyperlinks.TextToDisplay
Next cell
End Sub


What am I missing?

Any help would be appreciated

RK



-----Original Message-----
RK

I would like to have check boxes listed in my listbox

so I could select 1
or more to print.
However, I think that I have figured it out. I will

let you know if I have
any problems
with this on Thursday.


Change the ListStyle property to fmListStyleOption to

get checkboxes in your
listbox.

Thank you for your help. BTW I like your web site.


You're welcome, and thanks for reading my site.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com


.