here is the script o function
Function ArraysAreEqual (vA As Variant, vB As Variant) As Variant
Dim rez As Variant
rez = Evaluate({@implode(@sort(@Explode("} & Join(vA, "~") & {"; "~")); "~") = @implode(@sort(@Explode("} & Join(vB, "~") & {"; "~")); "~")})
If rez(0) = 0 Then ArraysAreEqual = False Else ArraysAreEqual = True
End Function
Dim rez As Variant
rez = Evaluate({@implode(@sort(@Explode("} & Join(vA, "~") & {"; "~")); "~") = @implode(@sort(@Explode("} & Join(vB, "~") & {"; "~")); "~")})
If rez(0) = 0 Then ArraysAreEqual = False Else ArraysAreEqual = True
End Function
advantages of my approach:
- more simple, just 1 line;
- faster;
- we can compare any number of arrays
but any advices will be appreciate! especially disadvantages !
3 comments :
Hi I have used your code and it has worked like a charm. Thank you for sharing it.
great code it's simple and works
thank you for this code! It's great.
Post a Comment