>>92
もっと具体的でないとスマートな(効率的な)式が分からないけど、
例にしているものをコードにするなら

Function Test() as Boolean
For Each x In Range(Cells(1, 1), Cells(1, Columns.Count).End(xlToLeft))
If x <> x.Offset(1, 0) Then Exit Function
Next

Test = True
End Function



Function Test(cond As Long) As Boolean
For i = 1 To cond
If Cells(1, i) <> Cells(2, i) Then Exit Function
Next
Test = True
End Function

かな。