Bonjour à tous
le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre de
méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
Merci pour l'aide :-)
amicalement
J@@
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== > '*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Bonjour à tous
le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre de
méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
Merci pour l'aide :-)
amicalement
J@@
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== > '*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Bonjour à tous
le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre de
méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
Merci pour l'aide :-)
amicalement
J@@
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== > '*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Bonsoir J@@
as tu vérifié les références?
décoches les "Manquant"
sinon MichDenis est dans les parages
Salutations
RaMa
"J@@"le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre de
méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
Merci pour l'aide :-)
amicalement
J@@
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== >>'*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Bonsoir J@@
as tu vérifié les références?
décoches les "Manquant"
sinon MichDenis est dans les parages
Salutations
RaMa
"J@@"
le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre de
méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
Merci pour l'aide :-)
amicalement
J@@
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== >>'*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Bonsoir J@@
as tu vérifié les références?
décoches les "Manquant"
sinon MichDenis est dans les parages
Salutations
RaMa
"J@@"le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre de
méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
Merci pour l'aide :-)
amicalement
J@@
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== >>'*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Bonjour Rama
tu veux dire quoi par "décoches les manquants"??
merci pour l'aide
@+
J@@Bonsoir J@@
as tu vérifié les références?
décoches les "Manquant"
sinon MichDenis est dans les parages
Salutations
RaMa
"J@@"le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre
de méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
Merci pour l'aide :-)
amicalement
J@@
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== >>>'*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Bonjour Rama
tu veux dire quoi par "décoches les manquants"??
merci pour l'aide
@+
J@@
Bonsoir J@@
as tu vérifié les références?
décoches les "Manquant"
sinon MichDenis est dans les parages
Salutations
RaMa
"J@@"
le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre
de méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
Merci pour l'aide :-)
amicalement
J@@
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== >>>'*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Bonjour Rama
tu veux dire quoi par "décoches les manquants"??
merci pour l'aide
@+
J@@Bonsoir J@@
as tu vérifié les références?
décoches les "Manquant"
sinon MichDenis est dans les parages
Salutations
RaMa
"J@@"le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre
de méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
Merci pour l'aide :-)
amicalement
J@@
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== >>>'*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Essaie cette syntaxe avec excel 97.... je ne l'ai pas testé mais ...!
Tu remplaces les 4 boucles de cette procédure
Sub ModifierCommandeAfficherMasquerLigneEtColonne
par ceci :
'-------------------------
With Application.CommandBars
.Item(1).FindControl(ID:3, Recursive:=True).OnAction = "MasquerLigne"
.Item(1).FindControl(ID:4, Recursive:=True).OnAction = "AfficherLigne"
.Item(1).FindControl(ID:6, Recursive:=True).OnAction = "MasquerColonne"
.Item(1).FindControl(ID:7, Recursive:=True).OnAction = "AfficherColonne"
.Item("Row").FindControl(ID:3, Recursive:=True).OnAction = "MasquerLigne"
.Item("Row").FindControl(ID:4, Recursive:=True).OnAction = "AfficherLigne"
.Item("Column").FindControl(ID:6, Recursive:=True).OnAction = "MasquerColonne"
.Item("Column").FindControl(ID:7, Recursive:=True).OnAction = "AfficherColonne"
End With
'-------------------------
Et il en est de même pour cette procédure :
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
With Application.CommandBars
.Item(1).FindControl(ID:3, Recursive:=True).OnAction = ""
.Item(1).FindControl(ID:4, Recursive:=True).OnAction = ""
.Item(1).FindControl(ID:6, Recursive:=True).OnAction = ""
.Item(1).FindControl(ID:7, Recursive:=True).OnAction = ""
.Item("Row").FindControl(ID:3, Recursive:=True).OnAction = ""
.Item("Row").FindControl(ID:4, Recursive:=True).OnAction = ""
.Item("Column").FindControl(ID:6, Recursive:=True).OnAction = ""
.Item("Column").FindControl(ID:7, Recursive:=True).OnAction = ""
End With
"J@@"
le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre
de méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== > '*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Essaie cette syntaxe avec excel 97.... je ne l'ai pas testé mais ...!
Tu remplaces les 4 boucles de cette procédure
Sub ModifierCommandeAfficherMasquerLigneEtColonne
par ceci :
'-------------------------
With Application.CommandBars
.Item(1).FindControl(ID:3, Recursive:=True).OnAction = "MasquerLigne"
.Item(1).FindControl(ID:4, Recursive:=True).OnAction = "AfficherLigne"
.Item(1).FindControl(ID:6, Recursive:=True).OnAction = "MasquerColonne"
.Item(1).FindControl(ID:7, Recursive:=True).OnAction = "AfficherColonne"
.Item("Row").FindControl(ID:3, Recursive:=True).OnAction = "MasquerLigne"
.Item("Row").FindControl(ID:4, Recursive:=True).OnAction = "AfficherLigne"
.Item("Column").FindControl(ID:6, Recursive:=True).OnAction = "MasquerColonne"
.Item("Column").FindControl(ID:7, Recursive:=True).OnAction = "AfficherColonne"
End With
'-------------------------
Et il en est de même pour cette procédure :
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
With Application.CommandBars
.Item(1).FindControl(ID:3, Recursive:=True).OnAction = ""
.Item(1).FindControl(ID:4, Recursive:=True).OnAction = ""
.Item(1).FindControl(ID:6, Recursive:=True).OnAction = ""
.Item(1).FindControl(ID:7, Recursive:=True).OnAction = ""
.Item("Row").FindControl(ID:3, Recursive:=True).OnAction = ""
.Item("Row").FindControl(ID:4, Recursive:=True).OnAction = ""
.Item("Column").FindControl(ID:6, Recursive:=True).OnAction = ""
.Item("Column").FindControl(ID:7, Recursive:=True).OnAction = ""
End With
"J@@"
le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre
de méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== > '*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Essaie cette syntaxe avec excel 97.... je ne l'ai pas testé mais ...!
Tu remplaces les 4 boucles de cette procédure
Sub ModifierCommandeAfficherMasquerLigneEtColonne
par ceci :
'-------------------------
With Application.CommandBars
.Item(1).FindControl(ID:3, Recursive:=True).OnAction = "MasquerLigne"
.Item(1).FindControl(ID:4, Recursive:=True).OnAction = "AfficherLigne"
.Item(1).FindControl(ID:6, Recursive:=True).OnAction = "MasquerColonne"
.Item(1).FindControl(ID:7, Recursive:=True).OnAction = "AfficherColonne"
.Item("Row").FindControl(ID:3, Recursive:=True).OnAction = "MasquerLigne"
.Item("Row").FindControl(ID:4, Recursive:=True).OnAction = "AfficherLigne"
.Item("Column").FindControl(ID:6, Recursive:=True).OnAction = "MasquerColonne"
.Item("Column").FindControl(ID:7, Recursive:=True).OnAction = "AfficherColonne"
End With
'-------------------------
Et il en est de même pour cette procédure :
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
With Application.CommandBars
.Item(1).FindControl(ID:3, Recursive:=True).OnAction = ""
.Item(1).FindControl(ID:4, Recursive:=True).OnAction = ""
.Item(1).FindControl(ID:6, Recursive:=True).OnAction = ""
.Item(1).FindControl(ID:7, Recursive:=True).OnAction = ""
.Item("Row").FindControl(ID:3, Recursive:=True).OnAction = ""
.Item("Row").FindControl(ID:4, Recursive:=True).OnAction = ""
.Item("Column").FindControl(ID:6, Recursive:=True).OnAction = ""
.Item("Column").FindControl(ID:7, Recursive:=True).OnAction = ""
End With
"J@@"
le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre
de méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== > '*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Commence par réinitialiser ta macro puis
dans l'éditeur VBA tu sélectionnes Outils/Références
regarde la liste
si tu as des "Manquant" (c'est écrit comme ça) il doit y avoir une coche.
enlève là
Si tu n'as pas de "Manquant" je n'ai pas de réponse et attend un autre
chaland .
"J@@"tu veux dire quoi par "décoches les manquants"??as tu vérifié les références?
décoches les "Manquant"
sinon MichDenis est dans les parages
"J@@"le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre
de méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== >>>>'*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Commence par réinitialiser ta macro puis
dans l'éditeur VBA tu sélectionnes Outils/Références
regarde la liste
si tu as des "Manquant" (c'est écrit comme ça) il doit y avoir une coche.
enlève là
Si tu n'as pas de "Manquant" je n'ai pas de réponse et attend un autre
chaland .
"J@@"
tu veux dire quoi par "décoches les manquants"??
as tu vérifié les références?
décoches les "Manquant"
sinon MichDenis est dans les parages
"J@@"
le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre
de méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== >>>>'*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************
Commence par réinitialiser ta macro puis
dans l'éditeur VBA tu sélectionnes Outils/Références
regarde la liste
si tu as des "Manquant" (c'est écrit comme ça) il doit y avoir une coche.
enlève là
Si tu n'as pas de "Manquant" je n'ai pas de réponse et attend un autre
chaland .
"J@@"tu veux dire quoi par "décoches les manquants"??as tu vérifié les références?
décoches les "Manquant"
sinon MichDenis est dans les parages
"J@@"le code de MichDenis fonctionne très bien sur XL2000, mais lorsque je
l'installe sur une machine en XL97 j'ai "Erreur de compilation : Membre
de méthode ou de donnée introuvable" pour FindControls dans les lignes
Application.CommandBars.FindControls(ID:3) etc
Comment l'adapter???
'**********************
'le code de TWB est en bas
'---------------------------------
Function SommeCelluleVisible(Rg As Range)
Application.Volatile
Dim T As Double, R As Range
For Each R In Rg.Rows
If R.Hidden = False Then
T = T + WorksheetFunction.Sum(R.Cells)
End If
Next
SommeCelluleVisible = T
End Function
'---------------------------------
Sub ModifierCommandeAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = "MasquerLigne"
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = "AfficherLigne"
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = "MasquerColonne"
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = "AfficherColonne"
Next
End Sub
'---------------------------------
Sub CommandeNORMALAfficherMasquerLigneEtColonne()
'Masquer les lignes
For Each C In Application.CommandBars.FindControls(ID:3)
C.OnAction = ""
Next
'Afficher les lignes
For Each C In Application.CommandBars.FindControls(ID:4)
C.OnAction = ""
Next
'Masquer les Colonnes
For Each C In Application.CommandBars.FindControls(ID:6)
C.OnAction = ""
Next
'Afficher les Colonnes
For Each C In Application.CommandBars.FindControls(ID:7)
C.OnAction = ""
Next
End Sub
'---------------------------------
Sub MasquerLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub AfficherLigne()
Application.ScreenUpdating = False
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Rows.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
Application.ScreenUpdating = True
End Sub
'---------------------------------
Sub MasquerColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = True
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
Sub AfficherColonne()
If TypeName(Selection) = "Range" Then
ActiveSheet.Unprotect
Selection.Columns.Hidden = False
ActiveSheet.Calculate
ActiveSheet.Protect
End If
End Sub
'---------------------------------
'**********************
'================================== >>>>'*************
' Dans ThisWorkBook
' pour calcul des cellules visibles seulement, voir code dans module std
'---------------------------
Private Sub Workbook_Activate()
Workbook_SheetActivate ActiveSheet
End Sub
'---------------------------
Private Sub Workbook_Deactivate()
CommandeNORMALAfficherMasquerLigneEtColonne
End Sub
'---------------------------
Sub Workbook_SheetActivate(ByVal Sh As Object)
'que pour la Feuil1
If Sh.Name = "Feuil1" Then
ModifierCommandeAfficherMasquerLigneEtColonne
Else
CommandeNORMALAfficherMasquerLigneEtColonne
End If
End Sub
'---------------------------
'*************