[vba] où est le pb?

E

Emilie

Guest
bonsoir,

voici une partie de ma macro. elle fonctionne très bien sous excel xp mais pas sur excel97 pourquoi?

Sub calcul()

Range("H:IV").Clear
tmp = Cells(65536, "A").End(xlUp).Row
tmp2 = Cells(tmp, "IV").End(xlToLeft).Column

For k = 2 To tmp
Cells(k, "F").Value = MonthName(Month(Cells(k, "A")))
Next k

For m = 1 To tmp
If Cells(m + 1, "D").Value = "hystéroscopie" Then Cells(m + 1, "D").Value = "hysteroscopie"
Next m


p1 = Application.CountIf(Sheets("feuil1").Range("F:F"), "Janvier")
p2 = Application.CountIf(Sheets("feuil1").Range("F:F"), "Février")
'de meme pour p3 jusqu'à p12

'janvier'
For i = 1 To p1
If Cells(i + 1, "D").Value = "amniocentese " Then p = p + 1
If Cells(i + 1, "D").Value = "vapo laser" Then q = q + 1
If Cells(i + 1, "D").Value = "hysteroscopie" Then r = r + 1
If Cells(i + 1, "D").Value = "pose implanon" Then s = s + 1
If Cells(i + 1, "D").Value = "retrait implanon" Then t = t + 1
Next i
Cells(tmp - 11, tmp2 + 3).Value = p
Cells(tmp - 11, tmp2 + 4).Value = q
Cells(tmp - 11, tmp2 + 5).Value = r
Cells(tmp - 11, tmp2 + 6).Value = s
Cells(tmp - 11, tmp2 + 7).Value = t

end sub


merci pour votre aide
Emilie
 

Discussions similaires

Réponses
0
Affichages
157
Réponses
5
Affichages
198