PC Review


Reply
Thread Tools Rate Thread

delete last-line help.

 
 
Matthew Dyer
Guest
Posts: n/a
 
      4th Aug 2010
I have a code that will delete the last line of a spreadsheet -

Range("a65536").End(xlUp).Select
Selection.EntireRow.Delete

What I'd like it to do is look into that line, and if the value for
the cell in column A is MTD_AVG to delete the line, but if it is
anything else to leave the line intact. Help please?
 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      4th Aug 2010
With Cells(Rows.Count, 1).End(xlUp)
If InStr(1, .Value, "MTD_AVG", vbBinaryCompare) > 0 Then
.EntireRow.Delete
End If
End With
--
Jim Cone
Portland, Oregon USA
Review: http://www.contextures.com/excel-sort-addin.html

..
..
..

"Matthew Dyer" <(E-Mail Removed)>
wrote in message
I have a code that will delete the last line of a spreadsheet -
Range("a65536").End(xlUp).Select
Selection.EntireRow.Delete

What I'd like it to do is look into that line, and if the value for
the cell in column A is MTD_AVG to delete the line, but if it is
anything else to leave the line intact. Help please?
 
Reply With Quote
 
Matthew Dyer
Guest
Posts: n/a
 
      4th Aug 2010
On Aug 4, 12:01*pm, "Jim Cone" <james.cone...@comcast.netXXX> wrote:
> With Cells(Rows.Count, 1).End(xlUp)
> * If InStr(1, .Value, "MTD_AVG", vbBinaryCompare) > 0 Then
> * * .EntireRow.Delete
> * End If
> End With
> --
> Jim Cone
> Portland, Oregon *USA
> Review: *http://www.contextures.com/excel-sort-addin.html
>
> .
> .
> .
>
> "Matthew Dyer" <matthew.e.d...@gmail.com>
> wrote in message
> I have a code that will delete the last line of a spreadsheet -
> Range("a65536").End(xlUp).Select
> Selection.EntireRow.Delete
>
> What I'd like it to do is look into that line, and if the value for
> the cell in column A is MTD_AVG to delete the line, but if it is
> anything else to leave the line intact. Help please?


works PERFECTLY! Thanks for the quick response!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? Microsoft Excel Programming 6 7th Oct 2009 12:28 PM
Excel Line Feed Character - How to delete the CHR(10) and keep the formatting without going to single line.. Microsoft Excel Discussion 7 7th Oct 2009 11:13 AM
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? Microsoft Excel Worksheet Functions 7 7th Oct 2009 11:10 AM
Delete line in sheet, deletes same line in add'l sheets =?Utf-8?B?U3VlMTI5NDU=?= Microsoft Excel Crashes 1 9th Jan 2007 07:25 AM
How do I delete single solid line, Auto, 1.5 pt line width? =?Utf-8?B?Q2Fyb2xlIGluIFZhY2F2aWxsZQ==?= Microsoft Word Document Management 1 8th Mar 2006 07:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:42 PM.