View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Loop not quite working correctly

Hi again,

Am Wed, 27 May 2015 10:48:16 +0200 schrieb Claus Busch:

Sub FilterOnBlankCells()


or try it this way. Connected cells are written as ranges:

Sub Test()
Dim OneRng As Range, sBlanks$, vMsg

Set OneRng = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
If Application.CountBlank(OneRng) = 0 Then
vMsg = "No blanks found"
Else
sBlanks = OneRng.SpecialCells(xlCellTypeBlanks).Address(0, 0)
sBlanks = Join(Split(sBlanks, ","), Chr(10))
vMsg = "Blanks found on the following cells:" & vbLf & vbLf & sBlanks
End If
MsgBox vMsg, vbInformation
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional