1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
Sub calcul()
'PARTIE 1///////////////////////////
'type variables itération
Dim i As Integer
Dim j As Integer
Dim Produits As String
Dim Enzyme As Double
Dim DossierTravail As String
Dim ouvre As String
Dim ouvre2 As String
Dim fichier As String
Dim nom As String
Application.ScreenUpdating = False 'pour désactiver le rafraichissement de l'écran pendant l'éxecution de la macro
fichier = "Produits" & ".xls"
DossierTravail = ActiveWorkbook.Path
ouvre = DossierTravail & "\test\" & fichier
ouvre2 = DossierTravail & "\Indicateurs_bdd_essai.xls"
Workbooks.Open Filename:=ouvre
For i = 1 To Sheets.Count
Sheets("i").Select
Range("S2").Select
nom = Range("S2").Value
For j = 1 To 181
' ////////////////// transposition Enzyme ///////////////////////////
If (Range("A" & j) = "Enzyme") Then
Range("H" & j).Select
Enzyme = Range("C" & j).Value
End If
' ////////////////// ecriture dans fichier de synthese///////////////////////////
ThisWorkbook.Activate
Sheets("Feuil3").Select
Range("Q" & i + 3) = nom
Range("R" & i + 3).Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = Enzyme
Next j
Next i
Workbooks(fichier).Close
End Sub |
Partager