![]() |
|
Forum
|
|
|||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
XLDnaute Junior
Date d'inscription: mai 2007
Messages: 99
|
Bonsoir à tous,
J'ai une macro dont une partie fonctionne mais pas la deuxième alors que le code semble identique. Voilà le code de la macro : Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim CellConc As Range
Dim Plage As Range
Dim TempConcatenation As String
Dim CellConc2 As Range
Dim Plage2 As Range
Dim TempConcatenation2 As String
With Sheets("Fiche de renseignements")
Set Plage = .Range("B209:B" & .Range("B231").Row)
For Each CellConc In Plage
TempConcatenation = CellConc & CellConc.Offset(0, 3)
If TempConcatenation = "" Then
If .Rows(CellConc.Row).Hidden = False Then
.Rows(CellConc.Row).Hidden = True
End If
ElseIf .Rows(CellConc.Row).Hidden = True Then
.Rows(CellConc.Row).Hidden = False
End If
Next
End With
With Sheets("Fiche de renseignements")
Set Plage2 = .Range("B236:B" & .Range("B258").Row)
For Each CellConc2 In Plage
TempConcatenation2 = CellConc2 & CellConc2.Offset(0, 3)
If TempConcatenation2 = "" Then
If .Rows(CellConc2.Row).Hidden = False Then
.Rows(CellConc2.Row).Hidden = True
End If
ElseIf .Rows(CellConc2.Row).Hidden = True Then
.Rows(CellConc2.Row).Hidden = False
End If
Next
End With
End Sub
Youri |
|
|
|
| ANNONCES | |||
|
|
|
|
#2 (permalink) |
|
XLDnaute Barbatruc
Date d'inscription: juin 2005
Localisation: RENNES
Version Excel : Excel 2000 (PC)
Messages: 6 777
|
Bonsoir
A mon avis Dans la deuxième partie de ta macro For Each CellConc2 In Plage est a remplacé par For Each CellConc2 In Plage2 |
|
|
|
|
|
#3 (permalink) |
|
XLDnaute Junior
Date d'inscription: mai 2007
Messages: 99
|
Bonjour Staple,
Merci beaucoup pour ta réponse, c'était exactement ça. C'est vraiment pernicieux le manque de sommeil ! Désolé pour ce poste inutile. Meilleures salutations, Youri |
|
|
|
| ANNONCES | |
![]() |
| Liens sociaux |
| Outils de la discussion | |
|
|
Discussions similaires
|
||||
| Discussion | Auteur | Forum | Réponses | Dernier message |
| Code copie lignes ne fonctionne pas | rudymagny | Forum Excel | 8 | 06/07/2006 19h42 |
| macro qui fonctionne ou pas | niki42 | Forum Excel | 4 | 11/04/2005 16h18 |
| Importation d’images, la Feuille 1 fonctionne, sa copie Feuill2 merdouille | Joëlle | Forum Excel Downloads - Archives | 6 | 29/09/2004 21h49 |
| Macro qui ne fonctionne pas! | Virginie© | Forum Excel Downloads - Archives | 10 | 03/02/2004 19h36 |
| filtre automatique: fonctionne et puis ne fonctionne plus | Luc | Forum Excel Downloads - Archives | 1 | 28/08/2003 14h15 |