Results 1 to 5 of 5

macro to delete last two rows

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-29-2008
    Location
    usa
    MS-Off Ver
    EXCEL 2010
    Posts
    116

    macro to delete last two rows

    i wrote this macro and want to delete last two rows on active sheet this macro doesnt work can anybody help me please!!


    Sub deleteLast2Rows()
    With ThisWorkbook.Worksheets(1)
    Dim rowNum As Integer
    Dim m As Range


    rowNum = 2
    Set m = .Range("A" & rowNum)
    rowNum = rowNum - 2

    EntireRow.Delete
    End With
    End Sub
    Last edited by martinez_pedro; 03-26-2009 at 03:21 PM.

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