View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Phillip[_5_] Phillip[_5_] is offline
external usenet poster
 
Posts: 33
Default Filling ListBox another excel file


Phillip London UK
This code works for me
Put in a standard module

Sub GetData()
Dim Data As Variant
Dim Lastrow As Integer

On Error Resume Next
Windows("Available quotes.xls").Activate
If Err 0 Then
Application.Workbooks.Open "Available quotes.xls"
End If
On Error GoTo 0

Lastrow = Worksheets(1).Range("b3").End(xlDown).Row
Set rangeforex = Worksheets(1).Range("b3").Resize(Lastrow - 2, 1)
Data = rangeforex.Value

Load Bond
Bond.lboxSpotForexavailable.List = Data
Bond.Show
End Sub