Monday, 20 May 2013

Different Excel Cell Types in VBA Macros

Below is the list of All Cell Types in VBA Macros


xlCellTypeAllFormatConditions  -   Cells of any format
xlCellTypeAllValidation              -  validation criteria Cells
xlCellTypeBlanks                        - Empty /Blank cells
xlCellTypeComments                  - Cells with comments
xlCellTypeConstants                   - Cells with constants values
xlCellTypeFormulas                    - Cells having formulas
xlCellTypeLastCell                     -  last cell in the used range
xlCellTypeSameFormatConditions  -  Cells having the same format
xlCellTypeSameValidation            -  Cells having the same validation criteria 
xlCellTypeVisible                          -  All visible cells

Example -

msgbox  Range("h3:h30").Cells.SpecialCells(xlCellTypeBlanks).Count

This will print the number of cells in given range that are of type - xlCellTypeBlanks. Means it will print the count of blank cells.

 

No comments:

Post a Comment

Popular Posts

Search This Blog