View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Count latest number of continous not-empty cells in a row.

Optionally...

Function GetLastGroupedCols(Rng As Range)
Dim Col1&, Col2&
Col1 = Cells(Rng.Row, Columns.Count).End(xlToLeft).Column
Application.Volatile
If Cells(Rng.Row, Col1).Offset(0, -1) = "" Then
GetLastGroupedCols = 1
Else
Col2 = Cells(Rng.Row, Col1).End(xlToLeft).Column
GetLastGroupedCols = Col1 - Col2 + 1
End If
End Function

--
Garry

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