Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default delete last-line help.

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default delete last-line help.

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"
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?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default delete last-line help.

On Aug 4, 12:01*pm, "Jim Cone" 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"
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
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
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? No Name Excel Programming 6 October 7th 09 12:28 PM
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? No Name Excel Worksheet Functions 7 October 7th 09 11:10 AM
Delete first line line(s) of text-file? Charlotte E.[_2_] Excel Programming 4 October 26th 08 08:31 AM
Delete every other line Andy Excel Programming 0 November 15th 05 07:09 PM
how to delete to the end of line sersi Excel Programming 0 November 10th 04 10:02 PM


All times are GMT +1. The time now is 01:40 AM.

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

About Us

"It's about Microsoft Excel"