changer macro

bingo57

XLDnaute Junior
bonjour


j'ai une macro pour compter les intervals max dans les lignes
comment faire pour avoir le meme calcul en colones

merci

Function Vide(ZZ As Range)
Application.Volatile
Dim Cel As Range
Dim Nbre As Byte
Dim Temp As Byte

If ZZ.Rows.Count > 1 Then
MsgBox "Une seule ligne Svp ?"
Exit Function
End If
For Each Cel In ZZ
If IsEmpty(Cel) Then
Nbre = Nbre + 1
Else
If Nbre > Temp Then Temp = Nbre
Nbre = 0
End If
Next Cel
Vide = Temp
End Function
 

pierrejean

XLDnaute Barbatruc
Re : changer macro

bonjour bingo57

Code:
Function Videcol(ZZ As Range)
Application.Volatile
Dim Cel As Range
Dim Nbre As Byte
Dim Temp As Byte
If ZZ.Columns.Count > 1 Then
MsgBox "Une seule colonne Svp ?"
Exit Function
End If
For Each Cel In ZZ
If IsEmpty(Cel) Then
Nbre = Nbre + 1
Else
If Nbre > Temp Then Temp = Nbre
Nbre = 0
End If
Next Cel
Videcol = Temp
End Function
 

Discussions similaires

Réponses
2
Affichages
154
Réponses
1
Affichages
248

Statistiques des forums

Discussions
312 291
Messages
2 086 851
Membres
103 400
dernier inscrit
MINOU WILL