Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I would like to know if a range contains any blank cells. Is there a shorter method than the one below that simply finds the first occurrence of an empty cell? Thanks. Blank = "No" For Each Cellrge In numtran If IsEmpty(Cellrge) = True Then Blank = "Yes" Exit For End If Next Cellrge |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If the block of cells is contiguous you can use something similar to the code
below to get a count of blank cells. Sub BlankCells() Dim l As Long Selection.CurrentRegion.Select Selection.SpecialCells(xlCellTypeBlanks).Select l = Selection.Cells.Count If l 0 Then 'Do something here Else 'Do something here End If End Sub -- Kevin Backmann "Bill" wrote: Hello, I would like to know if a range contains any blank cells. Is there a shorter method than the one below that simply finds the first occurrence of an empty cell? Thanks. Blank = "No" For Each Cellrge In numtran If IsEmpty(Cellrge) = True Then Blank = "Yes" Exit For End If Next Cellrge |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Blank = "No"
On Error Resume Next Set Cellrge = numtran.specialcells(xlCellTypeBlanks) On Error Goto 0 If Not Cellrge Is Nothing Then Blank = "Yes" End If -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Bill" wrote in message k.net... Hello, I would like to know if a range contains any blank cells. Is there a shorter method than the one below that simply finds the first occurrence of an empty cell? Thanks. Blank = "No" For Each Cellrge In numtran If IsEmpty(Cellrge) = True Then Blank = "Yes" Exit For End If Next Cellrge |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding data amongst empty cells | Excel Discussion (Misc queries) | |||
Finding next empty empty cell in a range of columns | Excel Programming | |||
Finding days between cells C and L where the cells may be empty | Excel Worksheet Functions | |||
finding/highlighting empty cells | Excel Programming | |||
Macro trouble finding 'empty' cells | Excel Programming |