View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
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.


Ah.., and I like it too!<g

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion