Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
one way to chek if is empty cell in column is
by dividinge the count cells in the rows in the column i tried to build a code like this: if counta(XXX)/rows(XXX)<1 then do ..... else ....... it didn't work i ask you to help me only by this way i think this code is wrong becuse of the dividing sign thank you rozent |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try:
Sub FindEmpty() Dim r As Range Set r = Range("A6:A26") 'Change to suit If Application.CountA(r) / r.Count < 1 Then MsgBox "Range has empty cell(s)" Else MsgBox "No empty cells in range" End If End Sub Sub FindEmpty2() Dim r As Range Dim NumEmpty As Long Set r = Range("A6:A26") 'Change to suit NumEmpty = r.Count - Application.CountA(r) MsgBox NumEmpty End Sub Regards, Greg "רוז×*ט" wrote: one way to chek if is empty cell in column is by dividinge the count cells in the rows in the column i tried to build a code like this: if counta(XXX)/rows(XXX)<1 then do ..... else ...... it didn't work i ask you to help me only by this way i think this code is wrong becuse of the dividing sign thank you rozent |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub FindEmpty()
Dim r As Range Set r = Range("A6:A26") 'Change to suit If Application.CountBlank(r) 1 Then MsgBox "Range has empty cell(s)" Else MsgBox "No empty cells in range" End If End Sub -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Greg Wilson" wrote in message ... Try: Sub FindEmpty() Dim r As Range Set r = Range("A6:A26") 'Change to suit If Application.CountA(r) / r.Count < 1 Then MsgBox "Range has empty cell(s)" Else MsgBox "No empty cells in range" End If End Sub Sub FindEmpty2() Dim r As Range Dim NumEmpty As Long Set r = Range("A6:A26") 'Change to suit NumEmpty = r.Count - Application.CountA(r) MsgBox NumEmpty End Sub Regards, Greg "?????" wrote: one way to chek if is empty cell in column is by dividinge the count cells in the rows in the column i tried to build a code like this: if counta(XXX)/rows(XXX)<1 then do ..... else ...... it didn't work i ask you to help me only by this way i think this code is wrong becuse of the dividing sign thank you rozent |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
When is a cell empty and how do I empty it. | Excel Discussion (Misc queries) | |||
format a cell with a formula so an empty reference cell shows blan | Excel Discussion (Misc queries) | |||
Leaving an empty cell empty | Excel Discussion (Misc queries) | |||
why a reference to an empty cell is not considered empty | Excel Discussion (Misc queries) | |||
Empty cell and a the empty String | Excel Programming |