View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JoeH[_2_] JoeH[_2_] is offline
external usenet poster
 
Posts: 1
Default Selecting a ListBox range

Hi there,

I am a novice at using VB and need some help.
I have created a list box that pulls it's info from another shee
labled "database". I need to be able to select a row from that list bo
and have certian values from that row pasted on another sheet. I hav
been able to paste the info but only from the last row that appears
not the one that is selected. I've though something along the lines o
Listbox_click event but don't know how to use it :( Here is the cod
that i have so far:

Dim BSapp_v2 As Workbook
Dim shtbsmain As Worksheet
Dim shtdatabase As Worksheet
Dim cl As Integer


Private Sub UserForm_Activate()
With Sheets("database")
For cl = 2 To 5000
If .Cells(cl, 4) = "" Then Exit For
Next
End With
cl = cl - 1
progListBox.RowSource = "database!$A$2:$V$" & Mid(Str(cl), 2)
End Sub

Private Sub btnOpen_Click()
If IsNull(progListBox) Then
Beep
MsgBox "No Reference Selected!", vbExclamation, ""
Exit Sub
End If

With Sheets("DataBase")

Load:
Range("Issr_local") = .Cells(cl, 2)
Range("Principal") = .Cells(cl, 4)

End With
Hide
End Sub

Private Sub btnCancel_Click()
Hide
End Sub

Any help would be greatly appreciated. Thank you for your time.

Jo

--
Message posted from http://www.ExcelForum.com