View Single Post
  #10   Report Post  
Dave Peterson
 
Posts: n/a
Default

Are you sure it's a listbox?

Are you sure you've got the correct dialogsheet?

(My only guesses...)

Brad Sumner wrote:

I had to put this project on the back burner for a bit but am now bat at it.
I used your code and recieved an error
"Unable to get the Listboxes property of the DialogSheet class"
To be honest I am not sure what that means. I am used to being able to name
every control and capture their events but the popup doesn't seem to do this
and it is confusing me a bit (and the help files are not very forthcomming
with info on it either)

"Dave Peterson" wrote:

I put this in a general module:

Option Explicit
Public weapon As Long

Sub dialog1_unload()

Dim myPopup As DialogSheet
Dim myString As String

Set myPopup = ThisWorkbook.DialogSheets("Popup")

If myPopup.ListBoxes("listbox5").Value < 1 Then
MsgBox "None selected!"
Exit Sub
End If

With myPopup.ListBoxes("listbox5")
myString = .List(.ListIndex)
End With

With Worksheets("Weapons and Armor")
Select Case weapon
Case 1
.Range("$D$18").Value = myString
Case 2
.Range("$G$18").Value = myString
Case 3
.Range("$J$18").Value = myString
Case 4
.Range("$M$18").Value = myString
Case 5
.Range("$P$18").Value = myString
End Select
End With

End Sub


--

Dave Peterson