Sub Macro1()
'
' Macro1 Macro
' Macro enregistrée le 22/06/2008 par PH CONSULTANTS
'
Dim Nom As String
Application.ScreenUpdating = False
ActiveSheet.Unprotect
[COLOR="Blue"]Nom = Sheets("Base").Range("B2")[/COLOR]
Sheets.Add
[COLOR="red"]ActiveSheet.Name = Nom[/COLOR]
Sheets("listing").Shapes("Button 3").Copy
ActiveSheet.Paste
Sheets("listing").Select
Range("A5").Select
[COLOR="red"]Sheets(Nom).Range("E4").Value = Nom[/COLOR]
Sheets("REPARTITION CHAMBRES").Select
Rows("7:7").Select
Selection.AutoFilter
[COLOR="red"]Selection.AutoFilter Field:=5, Criteria1:=(Nom)[/COLOR]
Range("E7:AP7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
[COLOR="red"]Sheets(Nom).Select[/COLOR]
Range("A7").Select
ActiveSheet.Paste
Range("F2").Value = "FICHE JOURNALIERE INDIVIDUELLE DE TRAVAIL"
With Range("F2:K3").Font
.Name = "Arial"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("G5").Value = Range("E4")
Range("F2:K3,G5:J5").Select
With Selection.Borders
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection
.Font.Bold = True
.MergeCells = True
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
Range("M2").Value = "Nb total de chambres"
Range("M4").Value = "Durée totale de travail"
With Range("M2:N2,M4:N4")
.MergeCells = True
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
End With
Range("O2").FormulaR1C1 = "=COUNTA(C[-13])-1"
Range("O4").FormulaR1C1 = "=SUM(R[4]C:R[8]C)"
Range("O2,O4").Select
With Selection.Borders
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
With Selection
.MergeCells = False
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.Font.Bold = True
End With
Range("E4").Font.ColorIndex = 2
Range("A7").Select
Sheets("REPARTITION CHAMBRES").Select
Selection.AutoFilter
Range("E7").Select
End Sub