Citation :
Sub RemplirCombo()
ExcelFile = "C:\Documents and Settings\admin\Bureau\Classeur1.xls"
Table = "Feuil1"
Set xlAppList = CreateObject("Excel.Application" )
Set MyWorkbook = xlAppList.Workbooks.Open(ExcelFile, 0, , , "" )
MyWorkbook.sheets(Table).Select
'pour trouver la derniere cellule remplie dans la colonne
For Each c In ActiveSheet.Range("A1", "A" & Trim(Str(Cells(65535, 1).End(xlUp).Row)))
LST.AddItem sheets(Table).Cells(c.Row, 1)
Next
MyWorkbook.Close savechanges:=True
Set xlAppList = Nothing
Set MyWorkbook = Nothing
End Sub
|