help with a range

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top