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
| Sub MAJ_Nom_Activite_dans_Indicateurs()
'
' MAJ_Nom_Activite_dans_Indicateurs Macro
' Vient mettre à jour le nom de l'activité pour un indicateur donné dans la feuille
' Indicateurs
'annulation de l'actualisation graphique d'Excel
Application.ScreenUpdating = False
'Déclaration variables
Dim Compteur As Integer
Dim Lignes_traitées As Integer
Dim NbLignes As Integer
'Initialisation variables
Compteur = 0
Lignes_traitées = 0
NbLignes = 0
'Choix de la feuille active
Worksheets("INDICATEURS").Select
'calcul nombre de lignes
NbLignes = WorksheetFunction.CountA(Range("E:E"))
' Positionnement sur première cellule
Range("R9").Select
' Lancement de la boucle et du traitement
For Compteur = 0 To NbLignes
If ActiveCell <> "" Then
ActiveCell.Offset(0, -10).Select
Selection.Copy
ActiveCell.Offset(0, 10).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, Transpose:=False
Lignes_traitées = Lignes_traitées + 1
End If
ActiveCell.Offset(1, 0).Select
Next Compteur
msgbox "Cette routine a traité " & Lignes_traitées & " lignes"
End Sub |
Partager