LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default To determine if selection range contains empty rows

I have selected a range with 20 rows and 10 columns.
I want to ensure that every rows in the selectin has
one value in it. Also, it should be ensured that every row has
just one value. ie. no two columns in the same row have data in
it. I tried the following code. I need the suggestions in it.
Thanks in advance.

Sub isrowempty(emptyrow As Boolean)
'to check if the selected row is empty or not
emptyrow = False
For i = 1 To Selection.Rows.Count
If IsEmpty(Selection.Range("A" & i)) Then
If IsEmpty(Selection.Range("B" & i)) Then
If IsEmpty(Selection.Range("C" & i)) Then
Mymsgbox "Selected Range Contains empty Row." _
& vbNewLine & " No Range in the selection
should be empty."
emptyrow = True
Exit Sub
End If
End If
End If

Next
End Sub
 
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
Remove empty rows from a range Albert Browne Excel Programming 3 October 14th 08 08:31 PM
Loop to determine number of rows range [email protected] Excel Programming 1 July 20th 07 09:20 AM
deleting empty rows within a range Bernie Deitrick Excel Programming 1 January 12th 07 07:21 PM
empty rows in range רוזנט Excel Programming 1 January 5th 06 09:08 PM
Selection range to last non empty cell Jaan Excel Programming 4 November 20th 05 07:56 AM


All times are GMT +1. The time now is 01:14 PM.

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

About Us

"It's about Microsoft Excel"