Posted to microsoft.public.excel.programming
|
|
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.
Very nice, Claus!
This would be much faster if the range was large and no blank cells.
--
Garry
Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public. vb.general.discussion
|