0
votes

I have 10 rows and 10 columns in an excel sheet. Within this range some of the cells have more than 300 characters. Can I get that particular cell range with the content having more than 300 characters?

like Range("A3,B5,A10").Select

Is there a way to get the range of cells like the above without using a loop in Javascript or Excel VBA?

1
Not without a loop, no.Rory

1 Answers

0
votes

Consider:

Sub GetTheBigOnes()
    Dim rFull As Range, rBig As Range
    Set rFull = Range("A1:J10")
    Set rBig = Nothing
    For Each r In rFull
        If Len(r.Value) > 300 Then
            If rBig Is Nothing Then
                Set rBig = r
            Else
                Set rBig = Union(rBig, r)
            End If
        End If
    Next r
    MsgBox rBig.Address(0, 0)
End Sub