View Single Post
  #7   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 Howard,

Am Tue, 26 May 2015 22:51:16 -0700 (PDT) schrieb L. Howard:

Thanks, Garry.


here is Garry's last version slightly amended:

Sub FilterOnBlankCells()
Dim OneRng As Range, c 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
For Each c In OneRng.SpecialCells(xlCellTypeBlanks)
sBlanks = sBlanks & "|" & c.Address(0, 0)
Next 'c
vMsg = "Blanks found on the following cells:" & vbLf & vbLf
vMsg = vMsg & Join(Split(Mid(sBlanks, 2), "|"), vbLf)
End If
MsgBox vMsg, vbInformation
End Sub


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