Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
only deletes first row with a blank cell in column "M" con't
It actually deletes the first two rows with "M" cells blank. This is a guess
but it seemed to stop deleting/checking rows on a cell where the one above it was blank also? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
only deletes first row with a blank cell in column "M" con't
Do you have a formula that is returning Blank??? If so then that code won't
work and you will need a loop or something similar... -- HTH... Jim Thomlinson "Janis" wrote: It actually deletes the first two rows with "M" cells blank. This is a guess but it seemed to stop deleting/checking rows on a cell where the one above it was blank also? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
only deletes first row with a blank cell in column "M" con't
Are the cells truely empty or do they have blank spaces in them. Give this a
try... Select Column M - F5 - Special Cells - Blanks If and or what gets highlighted? -- HTH... Jim Thomlinson "Janis" wrote: It actually deletes the first two rows with "M" cells blank. This is a guess but it seemed to stop deleting/checking rows on a cell where the one above it was blank also? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
only deletes first row with a blank cell in column "M" con't
How about this. It should delete all of the blank whether they are the result
of a formula or if the cell contains blank spaces... It is similat to waht you first posted... Sub DeleteBlanks() Dim rngToSearch As Range Dim rng As Range Dim rngToDelete As Range With ActiveSheet On Error Resume Next Columns("M").SpecialCells(xlCellTypeBlanks).Entire Row.Delete On Error GoTo 0 Set rngToSearch = .Range(.Range("M1"), .Cells(Rows.Count, "M").End(xlUp)) For Each rng In rngToSearch If Trim(rng.Value) = "" Then If rngToDelete Is Nothing Then Set rngToDelete = rng Else Set rngToDelete = Union(rng, rngToDelete) End If Next rng If Not rngToDelete Is Nothing Then rngToDelete.EntireRow.Delete End With End Sub -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: Do you have a formula that is returning Blank??? If so then that code won't work and you will need a loop or something similar... -- HTH... Jim Thomlinson "Janis" wrote: It actually deletes the first two rows with "M" cells blank. This is a guess but it seemed to stop deleting/checking rows on a cell where the one above it was blank also? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
only deletes first row with a blank cell in column "M" | Excel Programming | |||
What is a function in VBA EXCEL witch finds a string like "not" in cell and then deletes a row with this cell? | Excel Programming | |||
What is a function in VBA EXCEL witch finds a string like "not" in cell and then deletes a row with this cell? | Excel Worksheet Functions | |||
Changing "returned" values from "0" to "blank" | Excel Worksheet Functions |