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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
| Sub ACT_1()
'
' ACT_1 Macro
'
'Msgbox Ok + Annuler
yourmsgbox = MsgBox("ATTENTION: A n'utiliser que pour remplir le tableau vierge", vbOKCancel, "Confirmation")
If yourmsgbox = vbCancel Then
Exit Sub
End If
'
'Ouverture fichier analyse M-1
Sheets("Données").Select
Workbooks.Open Filename:=Range("h3").Value
'Copie des données du fichier M-1
Windows("Analyse Secteur 20-07.xlsm").Activate
Sheets("BDD Clients").Select
ActiveWorkbook.Worksheets("BDD Clients").AutoFilter.Sort.SortFields.Clear
ActiveSheet.ShowAllData
ActiveWorkbook.Worksheets("BDD Clients").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("BDD Clients").AutoFilter.Sort.SortFields.Add2 Key _
:=Range("H2:H1500"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("BDD Clients").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A3:N3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Analyse Secteur 20-08.xlsm").Activate
Sheets("BDD Clients").Select
ActiveWindow.SmallScroll Down:=-15
Range("BC3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("Analyse Secteur 20-07.xlsm").Activate
ActiveWindow.ScrollRow = 1480
ActiveWindow.ScrollRow = 1475
ActiveWindow.ScrollRow = 1459
ActiveWindow.ScrollRow = 1410
ActiveWindow.ScrollRow = 1136
ActiveWindow.ScrollRow = 656
ActiveWindow.ScrollRow = 339
ActiveWindow.ScrollRow = 184
ActiveWindow.ScrollRow = 164
ActiveWindow.ScrollRow = 50
ActiveWindow.ScrollRow = 32
ActiveWindow.ScrollRow = 3
ActiveSheet.Range("$A$2:$BB$1500").AutoFilter Field:=15, Criteria1:= _
"_Pas SF"
Range("F20:O20").Select
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlUp)).Select
ActiveWindow.SmallScroll Down:=-225
Range("F20:O20").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Windows("Analyse Secteur 20-08.xlsm").Activate
Range("E3").Select
ActiveSheet.Paste
Windows("Analyse Secteur 20-07.xlsm").Activate
ActiveSheet.Range("$A$2:$BB$1500").AutoFilter Field:=15
Sheets("Contacts").Select
Columns("A:F").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Analyse Secteur 20-08.xlsm").Activate
Sheets("Contacts").Select
Columns("A:F").Select
ActiveSheet.Paste
Sheets("BDD Clients").Select
End Sub |
Partager