1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub IMPORTREALISE()
Dim Db As DAO.Database
Dim strSQL As String
Dim derlign As Long, i As Long
'connexion à la base
Set Db = DAO.OpenDatabase("Q:\ECHANGE_FINANCE\Maintenance\SuiviMaintenance.mdb", False, False)
For i = 11 To 20000
strSQL = "INSERT INTO IMPORTPMCOUTMAINTENANCE VALUES ( '#" & Format(Range("a" & i), "mm/dd/yyyy") & "#' ,'" & Range("b" & i) & "' , '" & Range("c" & i) & "','" & Range("d" & i) & "','" & Range("e" & i) & "','" & Range("f" & i) & "','" & Range("g" & i) & "','" & Range("h" & i) & "','" & Range("i" & i) & "','" & Range("j" & i) & "')"
Db.Execute strSQL
Next i
'deconnexion de la base
Db.Close
End Sub |
Partager