View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Deleting data below last row in a determined range

Maybe...

Option Explicit
Sub testme()

Dim TopCell As Range

With ActiveSheet
If IsEmpty(.Cells(1, "C")) = False Then
Set TopCell = .Cells(1, "C")
ElseIf IsEmpty(.Cells(2, "C")) = False Then
Set TopCell = .Cells(2, "C")
Else
Set TopCell = .Cells(1, "C").End(xlDown)
End If

If TopCell.Row < .Rows.Count Then
.Range(TopCell.Offset(1, 0), .Cells(.Rows.Count, "C")).Clear
End If
End With

End Sub



matpj wrote:

I need to be able to delete all data BELOW the lst rows containing a
value in column C.

does anyone know how I might do this

--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=481022


--

Dave Peterson