Desole mais j'arrivais pas à joindre un fichier meme en suivant la procedure
I need your help!!!!!!!!!!!!!!!!!!!!!!
CETTE MACRO ACTUALISE TOUS MES TCD
Sub actualisationdonnees()
'
' actualisationdonnees Macro
' Macro enregistrée le 10/02/2006 par tmegueulle
'prend feuille lundi et actualise'
'
Sheets('lundi').Select
Range('B7').Select
ActiveSheet.PivotTables('Tableau croisé dynamique7').RefreshTable
'met en forme la feuille lundi'
Range('A8:H29').Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range('A4').Select
ActiveWindow.SmallScroll Down:=-3
Columns('I:I').Select
Selection.ColumnWidth = 9.86
Range('D1').Select
'prend feuille mardi et actualise te met en forme'
Sheets('mardi').Select
Range('C8').Select
ActiveSheet.PivotTables('Tableau croisé dynamique8').RefreshTable
Range('A9:H29').Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range('A4').Select
Columns('I:I').Select
Selection.ColumnWidth = 9.86
Range('D1').Select
'prend feuille mercredi et actualise te met en forme'
Sheets('mercredi').Select
Range('C8').Select
ActiveSheet.PivotTables('Tableau croisé dynamique8').RefreshTable
Range('A9:H29').Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range('A4').Select
Columns('I:I').Select
Selection.ColumnWidth = 9.86
Range('D1').Select
'prend feuille jeudi et actualise te met en forme'
Sheets('jeudi').Select
ActiveWindow.ScrollColumn = 1
Range('A7').Select
ActiveSheet.PivotTables('Tableau croisé dynamique8').RefreshTable
Range('A8:H29').Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range('A4').Select
Columns('I:I').Select
Selection.ColumnWidth = 9.86
Range('D1').Select
'prend feuille vendredi et actualise te met en forme'
Sheets('vendredi').Select
Range('A8').Select
ActiveSheet.PivotTables('Tableau croisé dynamique8').RefreshTable
Range('A9:H29').Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range('A4').Select
Columns('I:I').Select
Selection.ColumnWidth = 9.86
Range('D1').Select
'prend feuille samedi et actualise te met en forme'
Sheets('samedi').Select
Range('B7').Select
ActiveSheet.PivotTables('Tableau croisé dynamique1').RefreshTable
Range('A8:H29').Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Range('A4').Select
Columns('I:I').Select
Selection.ColumnWidth = 9.86
Range('D1').Select
'prend feuille tab dominique et actualise '
Sheets('tableau dominique').Select
ActiveWindow.SmallScroll Down:=-6
Range('B2').Select
ActiveSheet.PivotTables('Tableau croisé dynamique6').RefreshTable
ActiveWindow.ScrollWorkbookTabs Sheets:=-1
Sheets('Yves').Select
End Sub
CETTE MACRO ME PERMET DAJOUTER MES LIGNES
Sub Ajout()
Application.ScreenUpdating = False
For J = 6 To 1000
Sheets('Eleveur').Cells(J, 1).Select
If ActiveCell = '' Then
J = J - 1
Exit For
End If
Next J
Sheets('Eleveur').Select
Sheets('Eleveur').Range('C1').Select
Numero = ActiveCell
For K = 1 To 100
Sheets('Yves').Select
Sheets('Yves').Cells(K, 1).Select
If ActiveCell = '' Then
K = K - 1
Exit For
End If
Next K
For I = 6 To J
Sheets('Eleveur').Select
Sheets('Eleveur').Cells(I, 1).Select
If ActiveCell = Numero Then
Machaine = Sheets('Eleveur').Cells(I, 1)
Cherche = Right(Machaine, 4)
Sheets('Yves').Select
Sheets('Yves').Cells(K + 1, 1).Select
Selection.EntireRow.Insert
Sheets('Yves').Cells(K + 1, 1) = Cherche
Sheets('Yves').Cells(K + 1, 2) = Sheets('Eleveur').Cells(I, 3)
Sheets('Yves').Cells(K + 1, 3) = Sheets('Eleveur').Cells(I, 4)
Sheets('Yves').Cells(K + 1, 4) = Sheets('Eleveur').Cells(I, 5)
Sheets('Yves').Cells(K + 1, 5) = Sheets('Eleveur').Cells(I, 2)
Sheets('Yves').Cells(K + 1, 8) = Sheets('Eleveur').Cells(I, 1)
Sheets('Yves').Cells(K + 1, 11) = Sheets('Eleveur').Cells(I, 6)
Sheets('Yves').Cells(K + 1, 12) = Sheets('Eleveur').Cells(I, 7)
Sheets('Yves').Cells(K + 1, 13) = Sheets('Eleveur').Cells(I, 8)
Sheets('Yves').Cells(K + 1, 26).FormulaR1C1 = '=SUM(RC[-8]:RC[-2])'
Sheets('Yves').Cells(K + 1, 14).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlNotBetween, _
Formula1:='=$Z$' & K + 1 & '+($Z$' & K + 1 & '*2/100)', Formula2:='=$Z$' & K + 1 & '-($Z$' & K + 1 & '*2/100)'
Selection.FormatConditions(1).Font.ColorIndex = 3
Sheets('Eleveur').Select
Sheets('Eleveur').Visible = False
Sheets('Yves').Select
Exit For
End If
Next I
'
' Macro2 Macro
' Macro enregistrée le 13/02/2006 par tmegueulle
'
'
Range('AA2').Select
Selection.AutoFill Destination:=Range('AA2:AA30'), Type:=xlFillDefault
Range('AA2:AA30').Select
End Sub
Message édité par: thib, à: 17/03/2006 08:09