Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Deleting data below last row in a determined range


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

does anyone know how I might do this :confused

--
matp
-----------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=48102

  #2   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you have a formula range be determined by the location ofanother cell? Daniel[_3_] Excel Worksheet Functions 2 February 8th 08 03:01 PM
Saving a pre-determined range of cells as text? [email protected] Excel Discussion (Misc queries) 2 March 27th 07 11:58 PM
Deleting data below last row in a determined range matpj[_7_] Excel Programming 0 November 2nd 05 09:20 PM
Printing a range that is determined at run time Michel Pilon Excel Programming 3 May 20th 04 08:57 PM
Determined if filtered range is empty Fred Smith Excel Programming 5 February 22nd 04 03:54 PM


All times are GMT +1. The time now is 07:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"