+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    03-17-2010
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2007
    Posts
    13

    deleting rows with no information in certain columns

    I have a spread sheet with 5 coulmns (company/phone/fax/email/contact name)
    Column A is completely filled with 22,000 company names and other information is dispersed throughout the spreadsheet (ie some have just phone, some just fax and contact, some have nothing but company name)

    I want to delete all company entries that i have no information for; in columns b-e
    Last edited by MattyNinja; 03-19-2010 at 03:17 PM. Reason: solved

  2. #2
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,137

    Re: deleting rows with no information in certain columns

    You could add a formula in an unused column =COUNTA(B2:E2) and copy down, the filter for 0 and delete the visible rows.

    Or use VBA:

    Code:
    Sub x()
        Dim iRow        As Long
    
        With ActiveSheet
            With Intersect(.UsedRange, .Columns("B:E"))
                For iRow = .Rows.Count To 1 Step -1
                    With .Rows(iRow)
                        If WorksheetFunction.CountA(.Value) = 0 Then .EntireRow.Delete
                    End With
                Next iRow
            End With
        End With
    End Sub
    Last edited by shg; 03-17-2010 at 05:57 PM.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-17-2010
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: deleting rows with no information in certain columns

    You sir, are a gentleman and a scholar!

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.2.0