Intégrer code dans un autre
Bonsoir le forum,
j'ai ce code que je voudrais simplifier et que je voudrais mettre au début du code Trier_Sprint
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| Sub Copier_Sans_Formules_Sprint(ByVal WsName As String)
Application.ScreenUpdating = False
Range("GG7:GR105").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-96
Range("GG7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("GO4").Select
Application.CutCopyMode = False
Selection.ClearContents
Application.ScreenUpdating = True
End Sub |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub Trier_Sprint(ByVal WsName As String)
Application.ScreenUpdating = False
With ThisWorkbook.Worksheets(WsName)
.Range("GB6:GU105").Select
.Sort.SortFields.Clear
.Sort.SortFields.Add Key _
:=Range("GU7:GU105"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With .Sort
.SetRange Range("GB6:GU105")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
.Range("GB7").Select
End With
Application.ScreenUpdating = True
End Sub |
merci de votre aide