Can I check for equality of two worksheet ranges in VBA using the evaulate method?

JeffreyWeir

Super Moderator
Staff member
Joined
Mar 22, 2011
Messages
357
Reaction score
0
Points
0
Location
New Zealand
Hi all. I've got a worksheet that has named ranges called range1 and range2. Currently they both have the same data in then, so if I array enter the formula =range1=range2 then I get TRUE.

I want to check to see if these ranges are the same via VBA. Can I use evaluate or the [ ] notation to do this? MsgBox [a1= a1] evaluates to true, but MsgBox [a1:a2 = a1:a2] or msgbox [range1 = range2] gives me a type mismatch.

Can I test for equality in worksheet ranges in one operation as I can using =range1=range2 array entered in the worksheet, or do I have to loop through them cell by cell?

Thanks for any help.

Jeff
 
Top