|
-
Jul 7th, 2005, 08:17 AM
#1
Thread Starter
New Member
Problem with multiple selection listbox to cell
Hello all,
I am having a problem taking the selections from a multiple select enabled listbox and passing it onto an excel cell. I think I have the correct code, but I get an error message at runtime. Here is the code:
Private Sub testButton_Click()
Dim tmGasket
For i% = 0 To lsGasket.ListCount - 1
If lsGasket.Selected(i%) = True Then
MsgBox "Item number " & i% & " is selected " & lsGasket.List(i%)
tmGasket = tmGasket & " , " & lsGasket.List(i%)
End If
Next i%
Cells(locRow, locCol) = tmGasket
End Sub
and I get this error:
Run-time error '1004':
Application-defined or object defined error.
I can see the message boxes that pop up, so I know its taking the selections. When I debug it, it points me to the "Cells(locRow, locCol) = tmGasket" line. Am I just assigning it wrong? The excel parts work, I just am not sure what to do now. Any help would be greatly appreciated, thank you.
-Nino
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|