+ Reply to Thread
Results 1 to 3 of 3

empty cell

  1. #1
    רוזנט
    Guest

    empty cell

    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. #2
    Greg Wilson
    Guest

    RE: empty cell

    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. #3
    Bob Phillips
    Guest

    Re: empty cell

    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" <GregWilson@discussions.microsoft.com> wrote in message
    news:E6082D0A-6E2D-4C9C-810F-37DCE653D66F@microsoft.com...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1