Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   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

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default determining whether all cells in a row are blank

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.


  #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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining if a range of cells is missing a formula Bob Excel Worksheet Functions 6 December 20th 06 04:00 PM
Determining repeated cells between two workbooks farful Excel Programming 1 July 8th 06 06:55 PM
Determining which cells are locked. PCLIVE Excel Worksheet Functions 2 January 18th 06 03:08 PM
Determining the number of cells with data in a column Ken Loomis Excel Programming 5 July 11th 05 02:07 AM
Determining Start & End Points in Selected Cells Chris Hankin Excel Programming 4 June 28th 04 12:27 PM


All times are GMT +1. The time now is 04:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"