+ Reply to Thread
Results 1 to 4 of 4

"Run-time error '1004': App-dfnd or objt-dfnd err" Debug highlights ActiActiveCell.offset

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Wilmington, CA
    MS-Off Ver
    Excel 2003
    Posts
    5

    "Run-time error '1004': App-dfnd or objt-dfnd err" Debug highlights ActiActiveCell.offset

    Hello. I'm getting the "Run-time error '1004': Application-defined or object-defined error" when I run my code (see below). I'm attempting to identify the range beginning in H3 to last row in table and check each cell if = 0. If so, I want to add a thick top border to the entire row of that cell. And if, the cell = 0 and the adjacent cell equals 1 then add both a thick top and bottom border to the entire row of that cell. I tried my best to set it up but I get the above error and when I click Debug, the line that contains "ActiveCell.Offset(0, -7).Select" is highlighted. Please help. Thank you.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: "Run-time error '1004': App-dfnd or objt-dfnd err" Debug highlights ActiActiveCell.off

    Hi GMAGANA, try this:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Wilmington, CA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: "Run-time error '1004': App-dfnd or objt-dfnd err" Debug highlights ActiActiveCell.off

    Wow, amazing! Thanks for the quick reply. Out of curiosity, what do you think was the issue with my attempt?

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: "Run-time error '1004': App-dfnd or objt-dfnd err" Debug highlights ActiActiveCell.off

    I try to avoid using both the Select and Active functions as much as possible to minimize the interaction between Excel and VBA. I don't know exactly how your worksheet is structured, but the error came from using activecell (e.g. instead of just cell in this example) within the for each loop.

    Glad it worked

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Run-time error "1004" Application defined or object-define-error
    By josros60 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-21-2013, 01:14 PM
  2. Replies: 3
    Last Post: 01-08-2013, 10:36 AM
  3. Excel 2010 (Run-time error '13' type mismatch) "Debug" and "Continue" Grayed out.
    By Jeronimo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2012, 06:42 PM
  4. Array loop producing error "Run time error '1004'"
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-06-2011, 08:56 AM
  5. For each loop, 1004 error, if ... then "activecell.offset" attempt
    By AdamParker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-22-2010, 03:30 PM

Tags for this Thread

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