Another way IF your array is a String array (which your example seems to
indicate), this method will not work with a non-String array is like this...
If Replace(Join(YourArray, ""), YourArray(LBound(YourArray))) = "" Then
if you want case sensitive equality (one <> One); or like this...
If Replace(Join(YourArray, ""), YourArray(LBound( _
YourArray)), "", , , vbTextCompare) = "" Then
if you want case insensitive equality (one = One)
--
Rick (MVP - Excel)
"Shawn" <(E-Mail Removed)> wrote in message
news:AC11DF48-EBF6-45BB-AF45-(E-Mail Removed)...
> Does anyone have a good way in VBA to determine if every element in an
> array
> is the same/equal? Or if each item in a range is the same/equal? ie. are
> ('one','one','one') equal? Yes. Or are ('one','one','two') equal? No.
|