Results 1 to 3 of 3

VBA code to delete rows in a selected range.

Threaded View

  1. #1
    Registered User
    Join Date
    02-20-2009
    Location
    Modesto, California
    MS-Off Ver
    Excel 2003
    Posts
    19

    VBA code to delete rows in a selected range.

    I got the following code from Julian's Macro Tips web site. The code checks for null or empth string values and when they are found deletes those rows. Can anyone help me to rewite this to have it evaluate the active cell and if the value is notbetween 1999 and 3000 then delete those rows that meet the criteria?

    Sub DelEmptyRow()
    Rng = Selection.Rows.Count
    ActiveCell.Offset(0, 0).Select
    Application.ScreenUpdating = False
    For i = 1 To Rng
    If ActiveCell.Value = "" Then 
    Selection.EntireRow.Delete
    Else
    ActiveCell.Offset(1, 0).Select
    End If
    Next i
    Application.ScreenUpdating = True
    End Sub
    Any help would be much appreciated.
    Last edited by LD2020; 02-20-2009 at 06:34 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