Question : How do i pass data from one listbox to another listbox in vba.

I am trying to pass data from one listbox to another in powerpoint. the original listbox is pulling from an excel file. The listbox I am pulling from was set up using an array:

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Powerpoint/Q_24959635.html

I am trying to pass the parameters from this listbox into a summary listbox.

Any suggestions on what I am doing wrong is greatly welcomed.

Thanks...
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Private Sub lbFunds_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    For i = 0 To lbHoldings.ListCount - 1
        If lbFunds = lbHoldings.List(i) Then
            Beep
            Exit Sub
        End If
    Next i
    
    'this is where it is breaking
    Set SourceRange = Range(frmDimPres.lbFunds.List)
    strValue = SourceRange.Offset(lbFunds.ListIndex, 0).Resize(1, 1).Value
    refValue = SourceRange.Offset(lbFunds.ListIndex, 1).Resize(1, 1).Value
    
    'pass the value from the previous listbox into the listbox lbHoldings
    lbHoldings.AddItem strValue & refValue
 
End Sub

Answer : How do i pass data from one listbox to another listbox in vba.

First of all get rid of the Set SourceRange = Range(frmDimPres.lbFunds.List)
and make it
SourceRange = frmDimPres.lbFunds.List
and then with SourceRange(0, 0), SourceRange(0, 1), SourceRange(0, 1), SourceRange(1, 1) etc...
You can get the individual values.
Random Solutions  
 
programming4us programming4us