+ Reply to Thread
Results 1 to 2 of 2

Sorting and Deleting Empty Cell Ranges

  1. #1
    Registered User
    Join Date
    09-20-2006
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    5

    Question Sorting and Deleting Empty Cell Ranges

    Help I have a Large Workbook with multiple Worksheets/Macros.
    The workbook is used to import Traffic, format it and post it to other workbooks.

    The problem I have is sometimes there is NO traffic and I need to delete that range of cells so it won’t show on the Report.
    Example:

    If there is No Data in cells O2:R2 then Delete(up) cells A2:W2.
    This needs to be done for rows 2 through 26.
    I need to repeat the process for the following Ranges (Rows 2 thru 26):

    AA2:AW25
    BA2:BW25
    CA2:CW25
    DA2:DW25

    Needless to say with 25 Rows, and 4 separate sections of data, there will be a lot of repetition.

    Any and all suggestions ideas would be greatly appreciated.
    Attached Files Attached Files
    Last edited by VexedFist; 09-20-2006 at 03:45 PM. Reason: Adding Attachment

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    What you are asking for can be done via a macro.

    I hope I understand what you are after corettly

    try this macro

    Sub DelDells()
    Dim iRow As Integer
    For iRow = 26 To 2 Step -1
    If Cells(iRow, "o").Value = "" Then
    If Cells(iRow, "p").Value = "" Then
    If Cells(iRow, "q").Value = "" Then
    If Cells(iRow, "r").Value = "" Then
    Range("a" & iRow & ":w" & iRow).Delete Shift:=xlUp
    Range("ba" & iRow & ":bw" & iRow).Delete Shift:=xlUp
    Range("ca" & iRow & ":cw" & iRow).Delete Shift:=xlUp
    Range("da" & iRow & ":dw" & iRow).Delete Shift:=xlUp
    End If
    End If
    End If
    End If
    Next iRow
    End Sub

+ 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