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
| Sub Lister_Noms()
Dim f1 As Worksheet, f2 As Worksheet
Dim DerLig_f1 As Long, Lig As Long
Application.ScreenUpdating = False
Set f1 = Sheets("Liste")
Set f2 = Sheets("Etat")
DerLig_f1 = f1.Range("B" & Rows.Count).End(xlUp).Row
Lig = 1
For Each c In f1.Range(f1.Cells(2, "D"), f1.Cells(DerLig_f1, "D"))
f2.Cells(Lig, "J") = c.Value
Lig = Lig + 1
Next c
f2.Names.Add Name:="Liste", RefersToR1C1:="=Etat!R1C10:R" & Lig - 1 & "C10"
f2.Cells(5, "C").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=Liste"
.IgnoreBlank = True
.InCellDropdown = True
.ShowInput = True
.ShowError = True
End With
Set f1 = Nothing
Set f2 = Nothing
End Sub
Sub Imprimer()
ExecuteExcel4Macro "PRINT(1,,,1,,,,,,,,2,,,TRUE,,FALSE)"
End Sub |
Partager