Message d'erreur
Résolu
Noha-Diak
Messages postés
20
Date d'inscription
Statut
Membre
Dernière intervention
-
f894009 Messages postés 17277 Date d'inscription Statut Membre Dernière intervention -
f894009 Messages postés 17277 Date d'inscription Statut Membre Dernière intervention -
Bonjour, je bloque sur un problème sur mon petit programme, le petit macro compare deux colonne sur deux feuille différent la colonne D de la feuille N°1 a la colonne B de la feuille N°2 , mon problème est le suivant lorsque je filtre la colonne D de A à Z j'ai une erreur de compilation, je programme très peut en VBA et la je bloque vraiment merci d'avance pour votre aide voici le code :
If (NomF1 = "Ecole") Then ' modifier selon le fichier
colcomp1 = 4
colcomp2 = 2
Worksheets(NomF1).Activate
NblF1 = Cells.SpecialCells(xlCellTypeLastCell).Row ' ligne
NbcolF1 = Cells.SpecialCells(xlCellTypeLastCell).Column + 1 ' colonne
Range(Sheets(NomF1).Cells(2, colcomp1), Sheets(NomF1).Cells(NblF1, NbcolF1)).Sort
Key1:=Range(Sheets(NomF1).Cells(2, colcomp1), Sheets(NomF1).Cells(NblF1, colcomp1)),
Order1:=xlAscending ' erreur est ce trouve a ce niveau
Worksheets(NomF2).Activate
NblF2 = Cells.SpecialCells(xlCellTypeLastCell).Row ' ligne
NbcolF2 = Cells.SpecialCells(xlCellTypeLastCell).Column + 1 ' colonne
' adapter
Range(Sheets(NomF2).Cells(2, colcomp2), Sheets(NomF2).Cells(NblF2, NbcolF2)).Sort
Key1:=Range(Sheets(NomF2).Cells(2, colcomp2), Sheets(NomF2).Cells(NblF2, colcomp2)),
Order1:=xlAscending
For i = 2 To NblF1 ' adapter
contenu1 = Sheets(NomF1).Cells(i, colcomp1)
If (contenu1 = "") Then
i = NblF1
Else
For j = 2 To NblF2 ' adapter
contenu2 = Sheets(NomF2).Cells(j, colcomp2)
If (contenu1 = contenu2) Then
Sheets(NomF1).Cells(i, NbcolF1) = "Oui"
GoTo suivant4 ' modifier
ElseIf (contenu1 <> contenu2) And j = NblF2 Then
Sheets(NomF1).Cells(i, NbcolF1) = "Non"
End If
Next j
End If
suivant4: ' modifier
Next i
ps : ce programme fonctionne sur une autre macro.
If (NomF1 = "Ecole") Then ' modifier selon le fichier
colcomp1 = 4
colcomp2 = 2
Worksheets(NomF1).Activate
NblF1 = Cells.SpecialCells(xlCellTypeLastCell).Row ' ligne
NbcolF1 = Cells.SpecialCells(xlCellTypeLastCell).Column + 1 ' colonne
Range(Sheets(NomF1).Cells(2, colcomp1), Sheets(NomF1).Cells(NblF1, NbcolF1)).Sort
Key1:=Range(Sheets(NomF1).Cells(2, colcomp1), Sheets(NomF1).Cells(NblF1, colcomp1)),
Order1:=xlAscending ' erreur est ce trouve a ce niveau
Worksheets(NomF2).Activate
NblF2 = Cells.SpecialCells(xlCellTypeLastCell).Row ' ligne
NbcolF2 = Cells.SpecialCells(xlCellTypeLastCell).Column + 1 ' colonne
' adapter
Range(Sheets(NomF2).Cells(2, colcomp2), Sheets(NomF2).Cells(NblF2, NbcolF2)).Sort
Key1:=Range(Sheets(NomF2).Cells(2, colcomp2), Sheets(NomF2).Cells(NblF2, colcomp2)),
Order1:=xlAscending
For i = 2 To NblF1 ' adapter
contenu1 = Sheets(NomF1).Cells(i, colcomp1)
If (contenu1 = "") Then
i = NblF1
Else
For j = 2 To NblF2 ' adapter
contenu2 = Sheets(NomF2).Cells(j, colcomp2)
If (contenu1 = contenu2) Then
Sheets(NomF1).Cells(i, NbcolF1) = "Oui"
GoTo suivant4 ' modifier
ElseIf (contenu1 <> contenu2) And j = NblF2 Then
Sheets(NomF1).Cells(i, NbcolF1) = "Non"
End If
Next j
End If
suivant4: ' modifier
Next i
ps : ce programme fonctionne sur une autre macro.
A voir également:
- Message d'erreur
- Recuperer message whatsapp supprimé - Guide
- Message supprimé whatsapp - Guide
- Message absence thunderbird - Guide
- Epingler un message whatsapp - Accueil - Messagerie instantanée
- Message du pere noel gratuit whatsapp - Accueil - Messagerie instantanée
Quel est le message d'erreur. Votre fichier serait tres utile!!!