Delete rows
Option Explicit
sub test2()
dim myRng as range
dim myCell as range
dim DelRng as range
'just in case there's more than one area selected
set myrng = selection.areas(1).entirerow.columns(1) 'column A
for each mycell in myrng.cells
with mycell
if application.isnumber(.value) then
'skip it
else
if delrng is nothing then
set delrng = .cells
else
set delrng = union(delrng, .cells)
end if
end if
end with
next mycell
if delrng is nothing then
'nothing to delete
else
delrng.entirerow.delete
end if
end sub
nc wrote:
Sub test()
Selection.Rows.EntireRow.Delete
End Sub
Can you help ammend the above code to stop the row (selection) being deleted
if the cell in column A has a number.
--
Dave Peterson
|