Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Tom Ogilvy Wrote: Dim rng as Range, i as Long, lastrow as Long On error resume next set rng = Columns(1).Specialcells(xlblanks) rng.EntireRow.Delete set rng = columns(1).Specialcells(xlConstants,xlTextValues) rng.Entirerow.Delete On error go 0 lastrow = cells(rows.count,1).End(xlup).row for i = lastrow to 1 step -1 set cell = cells(i,1) if isnumeric(cell) then if cell4 or cell < 1 then rows(i).Delete end if else rows(i).delete end if Next Untested pseudocode. -- Regards, Tom Ogilvy "Brian Matlack" wrote: Hi! I want to delete all rows that do not contain the numbers 1, 2, 3 o 4 in column A. (some column A cells have letters and some are blan these are the ones I want to delete) How can I do this with a macro? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile http://www.excelforum.com/member.php...fo&userid=3508 View this thread http://www.excelforum.com/showthread...hreadid=524463 Thanks Tom this one works Great also! -- Brian Matlac ----------------------------------------------------------------------- Brian Matlack's Profile: http://www.excelforum.com/member.php...nfo&userid=350 View this thread: http://www.excelforum.com/showthread.php?threadid=52446 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
removing unneeded information | New Users to Excel | |||
Deleting unneeded rows and columns | Excel Discussion (Misc queries) | |||
password popup unneeded | Excel Programming | |||
Deleting unneeded characters in a cell | Excel Programming | |||
Deleting Unneeded Records | Excel Programming |