View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
rub rub is offline
external usenet poster
 
Posts: 21
Default determining whether all cells in a row are blank

Thanks. I will try it.


Alok wrote:
Hi Rub
Use this function

Public Function IsBlankRow(ByRef ws As Worksheet, ByVal lRow&) As Boolean
Dim c As Range
With ws
For Each c In .Rows(lRow).Cells
If c.Value < "" Then
IsBlankRow = False
Exit Function
End If
Next c
End With
IsBlankRow = True
End Function

You can call it as shown below
Isblankrow(worksheets("Sheet1"),5)
or
IsBlankRow(Sheet1,5)

the second version uses the programmatic name of the sheet and hence does
not need to be enclosed in double quotes.


"rub" wrote:

I want to delete rows that have nothing in the cells. How do I
determine whether all cells in a row are blank? Any help would be
greatly appreciated.