Il ne rentre pas dans ma macro
viret1290
Messages postés
146
Statut
Membre
-
viret1290 Messages postés 146 Statut Membre -
viret1290 Messages postés 146 Statut Membre -
Quelqu'un peux m'aider SVP
J'ai écris la macro suivante, mais elle ne rentre pas dedans même si les deux valeur sont identique pourqu'oi. je vous ai joint la macro complète
If FPresence.Cells(3, 23) = FServiceEtage.Cells(2, VarColonne) Then
mais si je remplace VarColonne par une colonne fixe ça marche impeccable.
Private Sub CommandButton1_Click()
Dim VarNbGard As Byte
Dim VarColonne As Integer
Dim i As Integer
Dim j As Integer
Dim L As Integer
VarNbGard = FBrigade.Cells(14, 2)
For VarColonne = 2 To 54
'If FPresence.Cells(3, 23) = FServiceEtage.Cells(2, 33) Then
If FPresence.Cells(3, 23) = FServiceEtage.Cells(2, VarColonne) Then
For i = 3 To FServiceEtage.Cells(1, 1) + 2 'On parcour le classeur Service Etage
For j = 15 To VarNbGard + 14 'On parcour les présences
If FPresence.Cells(j, 4) + FPresence.Cells(j, 5) = FServiceEtage.Cells(i, 2) + FServiceEtage.Cells(i, 3) Then
' FPresence.Cells(j, 9) = FServiceEtage.Cells(i, 33) 'Service Etage
FPresence.Cells(j, 9) = FServiceEtage.Cells(i, VarColonne) 'Service Etage
' j = 15
'i = i + 1
End If
' i = i + 1
Next
Next
End If
VarColonne = VarColonne + 1
Next
End Sub
MERCI D'AVANCE DE VOTRE AIDE
J'ai écris la macro suivante, mais elle ne rentre pas dedans même si les deux valeur sont identique pourqu'oi. je vous ai joint la macro complète
If FPresence.Cells(3, 23) = FServiceEtage.Cells(2, VarColonne) Then
mais si je remplace VarColonne par une colonne fixe ça marche impeccable.
Private Sub CommandButton1_Click()
Dim VarNbGard As Byte
Dim VarColonne As Integer
Dim i As Integer
Dim j As Integer
Dim L As Integer
VarNbGard = FBrigade.Cells(14, 2)
For VarColonne = 2 To 54
'If FPresence.Cells(3, 23) = FServiceEtage.Cells(2, 33) Then
If FPresence.Cells(3, 23) = FServiceEtage.Cells(2, VarColonne) Then
For i = 3 To FServiceEtage.Cells(1, 1) + 2 'On parcour le classeur Service Etage
For j = 15 To VarNbGard + 14 'On parcour les présences
If FPresence.Cells(j, 4) + FPresence.Cells(j, 5) = FServiceEtage.Cells(i, 2) + FServiceEtage.Cells(i, 3) Then
' FPresence.Cells(j, 9) = FServiceEtage.Cells(i, 33) 'Service Etage
FPresence.Cells(j, 9) = FServiceEtage.Cells(i, VarColonne) 'Service Etage
' j = 15
'i = i + 1
End If
' i = i + 1
Next
Next
End If
VarColonne = VarColonne + 1
Next
End Sub
MERCI D'AVANCE DE VOTRE AIDE
A voir également:
- Il ne rentre pas dans ma macro
- Telecharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Télécharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Jitbit macro recorder - Télécharger - Confidentialité
- Macro maker - Télécharger - Divers Utilitaires
- Les fonctionnalités suivantes ne peuvent pas être enregistrées dans des classeurs sans macro ✓ - Forum Excel
au plus simple, car je ne sais pas comment sont organisees vos donnees:
Private Sub CommandButton1_Click() Dim VarNbGard As Byte Dim VarColonne As Integer Dim i As Integer Dim j As Integer Dim L As Integer VarNbGard = Worksheets("FBrigade").Cells(14, 2) For VarColonne = 2 To 54 If Worksheets("FPresence").Cells(3, 23) = Worksheets("FServiceEtage").Cells(2, VarColonne) Then For i = 3 To Worksheets("FServiceEtage").Cells(1, 1) + 2 'On parcour le classeur Service Etage For j = 15 To VarNbGard + 14 'On parcour les présences If Worksheets("FPresence").Cells(j, 4) + Worksheets("FPresence").Cells(j, 5) = Worksheets("FServiceEtage").Cells(i, 2) + Worksheets("FServiceEtage").Cells(i, 3) Then Worksheets("FPresence").Cells(j, 9) = Worksheets("FServiceEtage").Cells(i, VarColonne) 'Service Etage End If Next j Next i End If Next VarColonne End Sub