View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Loop through Row Range, Excel 2000, 2003

Merry xmas eve
I corrected the 1st one from the original post and either of these will
work.
Your problem is that you want to EXIT the sub if all are blank. Of course,
if the first row is blank then the sub will NOT loop. What do you want?

Sub checkblanksinrow()
For i = 8 To 15
If Range("B" & i & ",d" & i & ":e" & i) = "" Then MsgBox Cells(i, "B").Row
Next i
End Sub
Sub checkblankinrow1()
For Each c In Range("b8:b15")
If c = "" And c.Offset(, 2) = "" And c.Offset(, 3) = "" Then MsgBox c.Row
Next
End Sub

--
Don Guillett
SalesAid Software

"jfcby" wrote in message
ups.com...
Hello,

My BEGIN row range is "B8,D8:E8" END row range is "B15,D15:E15". I need
to check each row value and if the row is all blank I want to exit sub,
if the row range has all data then I want go to continue macro, if a
row has a blank cell I want to continue macro.

This is a example code I've got so far but I do not know how to get it
to loop the the rows:

If Range("B8").Value & Range("D8").Value & Range("E8").Value = "" Then
Exit Sub

Thank you for your help in advance,
jfcby