Results 1 to 19 of 19

Thread: Count of Records IF

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13
    can you use macro-enabled workbook (xlsm)?
    Public Function fnCountHowManyLongLines(ByVal rng As Range) As Long
        Dim arr As Variant
        Dim i As Long, j As Long
        Dim s As String
        Dim cnt As Long    
        arr = rng    
        For i = 1 To UBound(arr, 1)
            s = ""
            For j = 1 To UBound(arr, 2)
                s = s & arr(i, j) & ""
            Next
            cnt = cnt + Abs(Len(s) > 256)
        Next
        fnCountHowManyLongLines = cnt
    End Function
    based on your demo xlsm, put the formula on any cell:

    =fnCountHowManyLongLines(A2:B3)
    result: 1
    Last edited by Aussiebear; 04-20-2025 at 04:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •