Sub testCreation()
Const DistAG2AJ As Long = 3
Const DistAG2B As Long = -31
Dim cellule As Range
'ThisWorkbook.Worksheets.Add
'Sheets.Add
'ActiveSheet.Name = "Liste des Demandes"
Call remplirFeuille
For Each cellule In Range("AG1:AG" & Range("AG65000").End(xlUp).Row)
If cellule.Value < cellule.Offset(0, DistAG2AJ) Then
cellule.Offset(0, DistAG2B).Font.Color = vbGreen
End If
Next
End Sub
Sub remplirFeuille()
'
' Macro1 Macro
' Macro enregistrée le 14/11/2008 par elhoumy
'
'
'creation de la feuille
Sheets.Add
ActiveSheet.Name = "Liste des Demandes"
ActiveCell.FormulaR1C1 = "Réf"
With ActiveCell.Characters(Start:=1, Length:=3).Font
.Name = "Arial"
.FontStyle = "Gras"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("B1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Numéro"
Range("C1").Select
Selection.Font.Bold = True
ActiveCell.FormulaR1C1 = "Vérsion réelle"
Columns("D:D").Select
Columns("C:C").ColumnWidth = 13.86
Range("D1").Select
ActiveCell.FormulaR1C1 = "Type"
With ActiveCell.Characters(Start:=1, Length:=4).Font
.Name = "Arial"
.FontStyle = "Gras"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("E1").Select
ActiveCell.FormulaR1C1 = "Devis de développement"
With ActiveCell.Characters(Start:=1, Length:=22).Font
.Name = "Arial"
.FontStyle = "Gras"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("F1").Select
Columns("E:E").ColumnWidth = 23.43
ActiveCell.FormulaR1C1 = "Raf dev + TU"
With ActiveCell.Characters(Start:=1, Length:=12).Font
.Name = "Arial"
.FontStyle = "Gras"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("G3").Select
Columns("F:F").ColumnWidth = 20.43
Columns("F:F").ColumnWidth = 14.57
End Sub