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
| Sub Probat()
Columns("F:F").Select
Selection.Find(What:="Total à périmètre comparable" & Chr(10) & "PLATRE" & Chr(10) & "CIMENT", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
lgfin1 = ActiveCell.Row - 1
ActiveSheet.Cells(2, 10).Value = lgfin1
Columns("F:F").Select
Selection.Find(What:="Total GENERAL" & Chr(10) & "PLATRE" & Chr(10) & "CIMENT", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
lgfin2 = ActiveCell.Row - 4
ActiveSheet.Cells(2, 10).Value = lgfin2
For nbcell = 2 To lgfin1
ActiveSheet.Cells(nbcell, 10).Formula = "=VLOOKUP(RC[-8],'[Probat]Prem''s'!C2:C8,7,FALSE)"
Next nbcell
For nbcell = lgfin1 + 4 To lgfin2
ActiveSheet.Cells(nbcell, 10).Formula = "=VLOOKUP(RC[-8],'[Probat]Prem''s'!C2:C8,7,FALSE)"
Next nbcell
End Sub |
Partager