Results 1 to 8 of 8

Object required error

Threaded View

  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:

    Sub DELETE_ZERO_QTY_ROWS()
    
    Dim currentCell
    Dim nextCell
        
    currentCell = ActiveCell.Address
                
    Do While Not IsEmpty(currentCell)
            
        nextCell = currentCell.Offset(1, 0)
                    
        If currentCell.Offset(0, 3).Value = 0 Then
                
            currentCell.EntireRow.Delete
    
        End If
       
        currentCell = nextCell
       
    Loop
    
    End Sub
    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.

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