je m'arrache les cheuveux depuis hier sur ce probleme
Code:
For i = Ligne_debut To ligne_fin
If Cells(i, 5).Value = '0' Then
Cells(i, 16) = 'Recirculation'
Else: Cells(i, 16) = 'Pulvérisation'
End If
Next i
i, ligne debut et ligne fin sont des integers.
Voila, en fait je veut regarder toutes les cellules dans la collone 5, entre le ligne_début et la ligne_fin. En fonction de la valeur, je veut ecrire 'Recirculation' ou 'Pulvérisation' dans la colonne 16 de mon tableau!
Mais a mon grand desespoir, excel refuse ma formule Cells(i, 5).Value = '0', et aussi Cells(i, 16) = 'Recirculation'
Sub recherche_pulvérisation()
'
' Macro permettant d'ajoutter en fin de chaque ligne l'information de recirculation ou de pulvérisation
'
' par jmt0 pour
Dim i As Integer
'For i = Ligne_debut To ligne_fin
' If i = i Then
'If Cells(i, 5).Value = '0' Then
' Cells(i, 16) = 'Recirculation'
' Else: Cells(i, 16) = 'Pulvérisation'
' End If
' Next i
For i = Ligne_debut To ligne_fin
If Range('E' & i).Value = '0' Then
Range('P' & i) = 'Recirculation'
Else: Range('P' & i) = 'Pulvérisation'
End If
Next i
End Sub
Sub gestionmacro()
Dim Ligne_debut As Long
Dim ligne_fin As Long
Dim Colonne_debut As Long
Dim Colonne_fin As Long
Application.ScreenUpdating = False
Call taille_tableau
Call recherche_pulvérisation
Application.ScreenUpdating = True
End Sub
edit :a l'heure actuel ca bloque la:
If Range('E' & i).Value = '0' Then
Sub recherche_pulvérisation()
'
' Macro permettant d'ajoutter en fin de chaque ligne l'information de recirculation ou de
pulvérisation
'
' par jmt0 pour
Dim i As Integer
'For i = Ligne_debut To ligne_fin
' If i = i Then
'If Cells(i, 5).Value = '0' Then
' Cells(i, 16) = 'Recirculation'
' Else: Cells(i, 16) = 'Pulvérisation'
' End If
' Next i
For i = Ligne_debut To ligne_fin
If Range('E' & i).Value = '0' Then
Range('P' & i) = 'Recirculation'
Else: Range('P' & i) = 'Pulvérisation'
End If
Next i
End Sub
Sub gestionmacro()
Application.ScreenUpdating = False
Call taille_tableau
Call recherche_pulvérisation
Application.ScreenUpdating = True
End Sub
Edition:
Je t'ai retiré le select inutile dans la recherche ligne et colonne