Results 1 to 30 of 30

Delete rows in Multiple Worksheets

Threaded View

phong919 Delete rows in Multiple... 12-21-2009, 05:43 PM
Leith Ross Re: Deleting rows in Multiple... 12-21-2009, 06:05 PM
phong919 Re: Deleting rows in Multiple... 12-21-2009, 06:09 PM
Leith Ross Re: Deleting rows in Multiple... 12-21-2009, 06:18 PM
phong919 Re: Deleting rows in Multiple... 12-22-2009, 10:34 AM
JBeaucaire Re: Deleting rows in Multiple... 12-22-2009, 11:23 AM
phong919 Re: Deleting rows in Multiple... 12-22-2009, 11:50 AM
JBeaucaire Re: Deleting rows in Multiple... 12-22-2009, 12:02 PM
phong919 Re: Deleting rows in Multiple... 12-22-2009, 12:39 PM
JBeaucaire Re: Deleting rows in Multiple... 12-22-2009, 01:37 PM
phong919 Re: Deleting rows in Multiple... 12-22-2009, 02:19 PM
phong919 Re: Deleting rows in Multiple... 12-22-2009, 03:58 PM
JBeaucaire Re: Deleting rows in Multiple... 12-22-2009, 04:18 PM
phong919 Re: Deleting rows in Multiple... 12-23-2009, 12:10 PM
JBeaucaire Re: Deleting rows in Multiple... 12-23-2009, 03:00 PM
phong919 Re: Deleting rows in Multiple... 12-23-2009, 03:20 PM
JBeaucaire Re: Deleting rows in Multiple... 12-23-2009, 03:09 PM
JBeaucaire Re: Deleting rows in Multiple... 12-23-2009, 03:18 PM
phong919 Re: Deleting rows in Multiple... 12-23-2009, 03:35 PM
phong919 Re: Deleting rows in Multiple... 12-23-2009, 04:01 PM
JBeaucaire Re: Deleting rows in Multiple... 12-23-2009, 04:07 PM
JBeaucaire Re: Deleting rows in Multiple... 12-23-2009, 04:03 PM
phong919 Re: Delete rows in Multiple... 12-28-2009, 04:37 PM
JBeaucaire Re: Delete rows in Multiple... 12-28-2009, 11:40 PM
phong919 Re: Delete rows in Multiple... 01-13-2010, 06:09 PM
JBeaucaire Re: Delete rows in Multiple... 01-13-2010, 08:56 PM
phong919 Re: Delete rows in Multiple... 01-18-2010, 09:08 PM
JBeaucaire Re: Delete rows in Multiple... 01-18-2010, 09:26 PM
phong919 Re: Delete rows in Multiple... 01-18-2010, 09:56 PM
JBeaucaire Re: Delete rows in Multiple... 01-19-2010, 01:38 AM
  1. #1
    Registered User
    Join Date
    09-11-2007
    Posts
    41

    Delete rows in Multiple Worksheets

    Hello all,

    I have about 51 worksheets in a workbook. I need to delete a couple of rows in column B. I try the following code and it's not working how i want it to. Can someone take a look and guide me in the right direction? I want to loop through all the worksheets and delete the rows.
    Sub WorksheetLoop()
    
        Dim WS_Count As Integer
        Dim I As Integer
        Dim sh As Worksheet
        Dim Last As Integer
        
            With Application
                .ScreenUpdating = False
                .EnableEvents = False
            End With
    
             ' Set WS_Count equal to the number of worksheets in the active
             ' workbook.
          WS_Count = ActiveWorkbook.Worksheets.Count 'Count of all Workheet tabs'
          Sheets("A1 Replace Citichecking").Activate
             ' Begin the loop.
            For Each sh In ActiveWorkbook.Worksheets
                
                Sheets("A1 Replace Citichecking").Select
                Last = Cells(Rows.Count, "B").End(xlUp).Row
            
            For I = 1 To Last
                If (Cells(I, "B").Value) = "19. B  Missed Deliveries - Reported Month" Then
                    Cells(I, "B").EntireRow.ClearContents ' USE THIS TO CLEAR CONTENTS BUT NOT DELETE ROW
                    Cells(I, "B").EntireRow.Delete
                End If
            Next I
                
            Next
    Last edited by Leith Ross; 12-21-2009 at 06:04 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