PC Review


Reply
Thread Tools Rate Thread

determining whether all cells in a row are blank

 
 
rub
Guest
Posts: n/a
 
      28th Nov 2006
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.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWxvaw==?=
Guest
Posts: n/a
 
      28th Nov 2006
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.
>
>

 
Reply With Quote
 
rub
Guest
Posts: n/a
 
      28th Nov 2006
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.
> >
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
determining if users Password is blank or standard Martin Microsoft Access Security 2 8th Aug 2009 03:59 PM
Determining if a user has a non-blank password =?Utf-8?B?Q2h1Y2sgVw==?= Microsoft Access Security 2 6th Aug 2009 03:48 AM
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Microsoft Excel Worksheet Functions 5 3rd Nov 2007 08:21 AM
Determining if certain row # is blank =?Utf-8?B?Qm9i?= Microsoft Excel Programming 4 24th Sep 2007 06:28 PM
Determining which cells are locked. PCLIVE Microsoft Excel Worksheet Functions 2 18th Jan 2006 03:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:00 AM.