Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range, rng1 as Range
if not isempty(Range("A1")) then On Error Resume Next set rng = Columns(1).SpecialCells(xlBlanks)(1) On Error goto 0 if not rng is nothing then set rng1 = Cells(rows.count,1).End(xlup) if rng1.Row rng.row then _ Range(rng,rng1).Entirerow.Delete end if Else Rows("1:65536").Delete End If If you know you will always have a blank cell and it won't ever be the A1 or A2 cell or the last cell in the column Range(cells(1,1).End(xldown)(1), _ Cells(rows.count,1).End(xlup)).Entirerow.Delete -- Regards, Tom Ogilvy Rich wrote in message ... Hi, Can somebody please help? I have a worksheet with around 700 rows but always only 7 columns, once I apply a sort I have one blank cell in Column A. I have a macro that sorts and adds functionality to the sheet but I need to be able to find this empty cell in column A, select this row, select all rows underneath that contain numeric data and delete them. I am new to this so your patience is appreciated if I ask dumb questions. Many thanks in advance for your help. Rich |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to select the first character in a cell and delete the rest | Excel Worksheet Functions | |||
Use find to select entire rows with a cell with that value | Excel Worksheet Functions | |||
Find a certain word in excel and select the cell | Excel Programming | |||
Find a cell then delete the row | Excel Programming | |||
Find a cell then delete the row | Excel Programming |