416-621-9348 cgreaves@chrisgreaves.com Visit www.ChrisGreaves.com for this image! Chris_GEDC1894_Head (Small).JPG
Home Site About Services Products

Public Function lngTestCell(cl As Range) As Long

How To Use This Page

Public Function lngTestCell(cl As Range) As Long
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' Function:   lngTestCell
'''
''' Comments:   Classify the contents of a cell
'''
''' Arguments:  RANGE
'''
''' Returns:    LONG
'''                     0 = Cell is ERROR
'''                     1 = Cell is empty
'''                     2 = Cell has zero-valued formula
'''                     3 = Cell has non-zero valued formula
'''                     4 = Cell has zero-value
'''                     5 = Cell has non-zero value
'''
''' Date        Developer       Action
''' --------------------------------------------------------------------------
''' 2009/01/03  Chris Greaves   Created
'''

The function makes use of established constants:

Public Const lngcTestCellIsError As Long = 0
Public Const lngcTestCellIsEmpty As Long = 1
Public Const lngcTestCellIsZeroFormula As Long = 2
Public Const lngcTestCellIsNonZeroFormula As Long = 3
Public Const lngcTestCellIsZeroData As Long = 4
Public Const lngcTestCellIsNonZeroData As Long = 5

Example of use

Sub TESTlngTestCell()
MsgBox lngTestCell(Selection.Rows(1).Cells(1))
End Sub

Loading

Toronto and Mississauga, Friday, March 19, 2010 1:50 PM

Copyright © 1996-2010 Chris Greaves. All Rights Reserved.