Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://stackoverflow.com/a/53196985/5079799

Public Function IsRngEmpty(ByVal rng As Range) As Boolean
 'https://stackoverflow.com/a/53196985/5079799
 Dim area As Range
 For Each area In rng.Areas
  If area.Cells.Count > 1 Then
   Dim arr As Variant
   arr = area.Value
   Dim cel As Variant
   For Each cel In arr
    If Len(Trim(cel)) > 0 Then
     IsRngEmpty = False
     Exit Function
    End If
   Next cel
  Else
   If Len(Trim(area.Value2)) > 0 Then
    IsRngEmpty = False
    Exit Function
   End If
  End If
 Next area
 IsRngEmpty = True
End Function
  • No labels