Rapport de message :*
 

Re: formule

Titre du sujet : Re: formule
par Mth le 13/11/2012 21:53:18

Bonsoir mahelnawe, bonsoir à tous,

Merci pour ton fichier qui éclaircit pas mal de choses.
Peux-tu essayer ce code et nous dire:

Option Explicit

 Sub Macro3()
  Dim c As Range, PlageA As Range, PlageB As Range, i As Long
 
With Application
    .ScreenUpdating = False
     
    With Sheets("GY")
        .Range("AE3:AS1003").ClearContents
        On Error Resume Next
       
        For Each c In .Range("AC3:AC1003").SpecialCells(xlCellTypeFormulas, 1)
            Set PlageA = .Range(c.Offset(0, -15), c.Offset(0, -1))
            Set PlageB = .Range(c.Offset(0, 2), c.Offset(0, 16))
            PlageA.Copy
            With PlageB
                .PasteSpecial Paste:=xlPasteValues
                .PasteSpecial Paste:=xlPasteFormats
            End With
        Next c
       
        On Error GoTo 0
       
        For i = 13 To 3 Step -1
            If IsEmpty(.Cells(i, 31)) Then
                .Range(.Cells(i, 31), .Cells(i, 45)).Select
                .Range(.Cells(i, 31), .Cells(i, 45)).Delete Shift:=xlUp
            End If
        Next i
      End With
     
      .CutCopyMode = False
      .ScreenUpdating = True
End With

End Sub
   

 


Bonne soirée,

mth