compter le nb de cellules comportant du texte

camiche

XLDnaute Junior
Bonjour le forum
J'ai encore besoin de vos compétences
je voudrais compter le nb de cellules comportant du texte dans une colonne.
Merci d'avoir la gentillesse de m'aider
CAMICHE
 

_Thierry

XLDnaute Barbatruc
Repose en paix
Bonjour enfin Bonsoir !!!

Redif d'une démoVBA ! Plus pour le Fun en fait !


Option Explicit

Sub CelluleFullStatistique()
Dim Plage As Range
Dim Total As Byte, NonVide As Byte, ValText As Byte, _
                    ValNume
As Byte, ValForm As Byte, _
                    ValErre
As Byte, ValVide As Byte, _
                    ValCond
As Byte, ValComm As Byte, _
                    ValVali
As Byte, valVisi As Byte
                   
Set Plage = Sheets('Feuil1').Range('A1:A100') ' A ADAPTER

Total = Plage.Count

On Error Resume Next
    NonVide = Plage.SpecialCells(xlCellTypeConstants, 23).Count
    ValVide = Plage.SpecialCells(xlCellTypeBlanks).Count
    ValText = Plage.SpecialCells(xlCellTypeConstants, xlTextValues).Count
    ValNume = Plage.SpecialCells(xlCellTypeConstants, xlNumbers).Count
    ValForm = Plage.SpecialCells(xlCellTypeFormulas).Count
    ValErre = Plage.SpecialCells(xlCellTypeFormulas, xlErrors).Count
    ValCond = Plage.SpecialCells(xlCellTypeAllFormatConditions).Count
    ValComm = Plage.SpecialCells(xlCellTypeComments).Count
    ValVali = Plage.SpecialCells(xlCellTypeAllValidation).Count
    valVisi = Plage.SpecialCells(xlCellTypeVisible).Count


MsgBox 'La Zone contient ' & Total & ' cellules répartient comme suit : ' & vbCrLf _
        & vbTab & 'Cellule Non Vide' & vbTab & vbTab & ': ' & NonVide & vbCrLf _
        & vbTab & 'Cellule Etant vide' & vbTab & vbTab & ': ' & ValVide & vbCrLf _
        & vbTab & 'Cellule Ayant du Texte' & vbTab & ': ' & ValText & vbCrLf _
        & vbTab & 'Cellule Valeur Numérique' & vbTab & ': ' & ValNume & vbCrLf _
        & vbTab & 'Cellule Avec Formule' & vbTab & ': ' & ValForm & vbCrLf _
        & vbTab & 'Cellule Etant en Erreur' & vbTab & ': ' & ValErre & vbCrLf _
        & vbTab & 'Cellule Format Conditionnel' & vbTab & ': ' & ValCond & vbCrLf _
        & vbTab & 'Cellule Avec Commentaire' & vbTab & ': ' & ValComm & vbCrLf _
        & vbTab & 'Cellule Critère de validation' & vbTab & ': ' & ValVali & vbCrLf _
        & vbTab & 'Cellule Visible' & vbTab & vbTab & ': ' & valVisi & vbCrLf


End Sub


Bonne Soirée
@+Thierry
 

Discussions similaires

Statistiques des forums

Discussions
312 480
Messages
2 088 756
Membres
103 947
dernier inscrit
Quentin_sf