+ Reply to Thread
Results 1 to 2 of 2

Runtime error 1004

  1. #1
    Registered User
    Join Date
    03-09-2005
    Posts
    19

    Runtime error 1004

    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

  2. #2
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845
    Hi,

    It could be your code: Sht1.Cells(i, 0) i refers to the Row, but 0 should be the column.
    I think you should changed to Sht1.Cells(i, 1) thats if you are refering to column 1.

    Charles

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1