View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default help with a range

very simple code.

Sub deleteR1R3()
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
If (LastRow = 1) And IsEmpty(Range("A1")) Then
Cells(3, "A").EntireRow.Delete
Cells(1, "A").EntireRow.Delete
End If
End

"Janis" wrote:

I just want to delete the first and third row if column "A" is blank. THis
script deletes the first row. I need to add to the range the 3rd row. Can
you help me change the range?

thanks,


Sub deleteDateRow1()

Dim Rng As Range

Set Rng = Range("A1")

With Rng
If Columns("A").SpecialCells(xlCellTypeBlanks) Then


.EntireRow.Delete Shift:=xlUp


Else
Exit Sub
End If
End With
End Sub