Afficher un message
Vieux 13/12/2005, 00h51   #9 (permalink)
Dan
XLDnaute Barbatruc
 
Avatar de Dan
 
Date d'inscription: février 2005
Localisation: Liège
Version Excel : Excel 2004 (MAC)
Messages: 3 551
Par défaut Re:Protection et mise a jour

Bonsoir,

Voici une proposition.

1. Vas dans VBA par ALT + F11
2. CTRL + R pour accéder à VBA Project
3. Là double clique sur la feuille où se trouve le TCD
4. Place ces macros
Code:
Private Sub Worksheet_Activate()
'Macro par DAN pour stefane3879 - http://www.excel-downloads.com/forum...ise-a-jour.htm
Application.ScreenUpdating = False
With activesheet
.unprotect
.PivotTables('TCD').EnableWizard = False
End With
Call ActualiseTCD
Activesheet.protect
Application.ScreenUpdating = True
End Sub
Code:
Private Sub Worksheet_Deactivate()
'Macro par DAN pour stefane3879 - http://www.excel-downloads.com/forum...ise-a-jour.htm
Application.ScreenUpdating = False
Activesheet.PivotTables('TCD').EnableWizard = True
Application.ScreenUpdating = True
End Sub
5. Toujours en VBA, vas dans menu / insertion et ajoute un 'Module'
6. Le module créé te montre une fenetre vierge à droite
7. Place cette macro
Code:
Sub ActualiseTCD()
'Macro par DAN pour stefane3879 - http://www.excel-downloads.com/forum...ise-a-jour.htm
Dim PvtTable As PivotTable
With Application
.ScreenUpdating = False
.CommandBars('PivotTable').Visible = False
End With
Set PvtTable = Worksheets('Tata').Range('X').PivotTable
PvtTable.RefreshTable
Application.ScreenUpdating = True
End Sub
Avec :
TATA = le nom du TCD. A obtenir par clique droite dans le TCD, puis cliquer sur Option – le nom est placé en haut à gauche
X : la première cellule du TCD en haut à gauche

8. enregistre le tout.

Si pb n'hésite pas

Dan est déconnecté   Réponse avec citation