View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default delete all rows above a selected cell

Sub DeleteAbove()
Dim rng As Range

On Error Resume Next
Set rng = ActiveCell.Offset(-1, 0)
On Error GoTo 0
If Not rng Is Nothing Then _
Range("A1", ActiveCell.Offset(-1, 0)).EntireRow.Delete
End Sub

--
HTH...

Jim Thomlinson


"rroach" wrote:


I have a macro that selects a specific (and different in each worksheet)
cell based on cell contents. From that cell location (it is the
activated cell at current step of macro) I want to highlight and delete
all rows in the worksheet above to the top of the worksheet. I'm stuck.
Any ideas?


--
rroach
------------------------------------------------------------------------
rroach's Profile: http://www.excelforum.com/member.php...o&userid=21093
View this thread: http://www.excelforum.com/showthread...hreadid=378687