Results 1 to 8 of 8

macro not giving desired output

Threaded View

  1. #1
    Registered User
    Join Date
    03-19-2009
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    9

    macro not giving desired output

    Hello All,

    I have attached an excel spreadsheet wherein it has three worksheet with same data structure. I want macro written and working for all three worksheets as currently it is working for one sheet at aa time and has to be invoked again and again
    ------code starts from here----------
    Sub DeleteBlankRows()
    Dim LASTROW As Long
    Dim ws As Worksheet
    For Each ws In ThisWorkbook.Worksheets
    LASTROW = ActiveSheet.UsedRange.Rows.Count
    Application.ScreenUpdating = False
      
    For i = LASTROW To 1 Step -1
        If Application.CountA(Cells(i, 1).EntireRow) = 0 Then
           Cells(i, 1).EntireRow.Delete
        End If
    Next i
    
    Application.ScreenUpdating = True
    Next ws
    End Sub
    --------code ends here-----

    Any help provided would be appreciated.

    Regards
    Last edited by royUK; 03-23-2009 at 03:15 AM.

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