Here is the offending code:


If Sht1.Cells(i, 0) <> Sht1.Cells(h, 0) Then


variables i and h are defined as integers and they are given a value.

I have tried various permutations to reference the cells that I need to compare and still get the error.

The error is :

Run-time error '1004': Application-defined or orbject-defined error

Thoughts as to why this doesn't work would be appreciated.

Jack