Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete line
Hi,
I want to write a macro that looks at a sheet, and any line found with a '0' in a particular column gets deleted. I.E If the macro finds a '0' in A5 then it deletes the whole of the '5' row. Any ideas |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete line
Once you've found the range with the '0'
{range}.EntireRow.Delete will delete the row. If you have done a select so the '0' is the current position of the cursor, then ... activecell.EntireRow.Delete "Kevin Depree" wrote in message ... Hi, I want to write a macro that looks at a sheet, and any line found with a '0' in a particular column gets deleted. I.E If the macro finds a '0' in A5 then it deletes the whole of the '5' row. Any ideas |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete line
Hi,
Try something like: Sub DeleteRowsUsingAutoFilter() Dim lLastRow As Long Dim Rng As Range Application.ScreenUpdating = False Rows(1).Insert Range("A1").Value = "Temp" With ActiveSheet .UsedRange lLastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row Set Rng = Range("A1", Cells(lLastRow, "A")) Rng.AutoFilter Field:=1, Criteria1:="0" Rng.SpecialCells(xlCellTypeVisible).EntireRow.Dele te .UsedRange End With End Sub John Mansfield pdbook.com -----Original Message----- Hi, I want to write a macro that looks at a sheet, and any line found with a '0' in a particular column gets deleted. I.E If the macro finds a '0' in A5 then it deletes the whole of the '5' row. Any ideas . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro code to put series name next to individual line in line grap | Charts and Charting in Excel | |||
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? | Excel Worksheet Functions | |||
How do i delete a macro in Excel 2003 when delete isn't highlight | Excel Discussion (Misc queries) | |||
Macro data selection line delete | Excel Discussion (Misc queries) | |||
Macro to delete first line of 200+ files | Excel Discussion (Misc queries) |