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
|
Public Sub Faire_Si_EN_LIGNE()
Dim Col As Integer
Dim Ligne As Integer: Ligne = 10
Dim i As Integer
Dim ws As Worksheet: Set ws = Application.Sheets("TEST")
With ws
.Activate
For Col = 2 To 7
i = i + 1
.Cells(Ligne, Col).Activate
ActiveCell.FormulaR1C1 = "=IF(RC[" & -i & "]=1,10,100)"
Next Col
End With
Set ws = Nothing
End Sub
Public Sub Faire_Si_EN_COLONNE()
Dim Col As Integer: Col = 3
Dim Ligne As Integer
Dim i As Integer: i = 1
Dim ws As Worksheet: Set ws = Application.Sheets("TEST")
With ws
.Activate
For Ligne = 2 To 7
.Cells(Ligne, Col).Activate
ActiveCell.FormulaR1C1 = "=IF(RC[" & -i & "]=1,10,100)"
Next Ligne
End With
Set ws = Nothing
End Sub |
Partager