+ Reply to Thread
Results 1 to 8 of 8

Object required error

  1. #1
    Registered User
    Join Date
    06-24-2010
    Location
    Cornwall, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    7

    Object required error

    Mornin',

    Here's the code:

    Please Login or Register  to view this content.
    I get an "object required" error on the nextCell = currentCell.Offset(1, 0) line. WHat I'm trying to achieve is rather simple.

    Columns A, B and C

    A = title
    B = description
    C = quantity

    Delete all 0 quantity rows.

    Seems like the code should work.....a little stumped.

    Thanks again!

    - Lou
    Last edited by CanadianGSX; 06-25-2010 at 02:19 PM. Reason: Added Code tags.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Object required error

    You need Set with objects:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    06-24-2010
    Location
    Cornwall, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Object required error

    I get the same error but on the IF statement now

    Please Login or Register  to view this content.
    I had tried with Set as well....I had also tried setting the currentCell as Range to no avail...I get the same error.

    Thanks for the quick reply though!

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Object required error

    Sorry - cocked up my pasting. That should have read:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-24-2010
    Location
    Cornwall, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Object required error

    Now it deletes the ActiveCell line no matter where the active cell is ONCE and gives the same error at the IF statement....going for lunch...need to clear my head.

    Thanks again for the help thus far!

  6. #6
    Registered User
    Join Date
    06-24-2010
    Location
    Cornwall, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Object required error

    Here's an updated code that returns the Type Mismatch error at the ' Set currentCell = ActiveCell.Address ' line:

    For the life of me I can't seem to put my finger on the issue...

    Thanks yet again!

    -Lou

    Please Login or Register  to view this content.

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Object required error

    You don't want the .Address bit. Try:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-24-2010
    Location
    Cornwall, Ontario
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Object required error

    Perfect...thanks!

    Here's the final code that works like a charm:

    Please Login or Register  to view this content.

+ 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