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
| Sub CCFormulesValeurs()
Sheets("Plan Projet").Activate
Dim DernLignePP As Long
DernLignePP = Range("A" & Rows.Count).End(xlUp).Row
Dim DernColonnePP As Long
DernColonnePP = Cells(7, Cells.Columns.Count).End(xlToLeft).Column
Dim i As Integer
i = 0
While i < DernColonnePP + 1
If Cells(8, i).HasFormula Then
Dim j As Integer
j = 0
While Cells(8, i + j).HasFormula
Dim DernJ As Integer
DernJ = j
j = j + 1
Wend
Range(Cells(8, i), Cells(8, i + DernJ)).Copy
Range(Cells(9, i), Cells(DernLignePP, i + DernJ)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End If
i = i + DernJ + 1
Wend
End Sub |
Partager