View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
isabelle isabelle is offline
external usenet poster
 
Posts: 587
Default Count latest number of continous not-empty cells in a row.

hi Jan,

another solution with VBA
rng can be a whole line or a line part

Function MyCount(rng As Range)
Dim i As Integer
Dim lastCol As Integer
lastCol = Cells(rng.Row, rng.Columns.Count).End(xlToLeft).Column
i = lastCol
While Not IsEmpty(Cells(rng.Row, i))
i = i - 1
Wend
MyCount = Application.CountA(Range(Cells(rng.Row, i), Cells(rng.Row, lastCol)))
End Function

isabelle