Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to delete rows if cell blank in column
Hi, i need a macro to delete empty rows if a cell in A3:A200 is blank.
Ex: A B C 3 FILL FILL FILL 4 FILL FILL 5 FILL FILL FILL 6 7 FILL FILL FILL In this example, i need to delete row 4 and 6. Can this be done? Thanks! |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to delete rows if cell blank in column
Hi
Try this: Sub DeleteRows() FirstRow = 3 LastRow = 200 For r = LastRow To FirstRow Step -1 If Range("A" & r).Value = "" Then Rows(r).EntireRow.Delete End If Next End Sub Regards, Per "puiuluipui" skrev i meddelelsen ... Hi, i need a macro to delete empty rows if a cell in A3:A200 is blank. Ex: A B C 3 FILL FILL FILL 4 FILL FILL 5 FILL FILL FILL 6 7 FILL FILL FILL In this example, i need to delete row 4 and 6. Can this be done? Thanks! |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to delete rows if cell blank in column
Sub rowkiller()
Set r = Range("A3:A200") Set rr = r.SpecialCells(xlCellTypeBlanks) rr.EntireRow.Delete End Sub -- Gary''s Student - gsnu200907 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to delete rows if cell blank in column
It's working.
Thanks! "Per Jessen" wrote: Hi Try this: Sub DeleteRows() FirstRow = 3 LastRow = 200 For r = LastRow To FirstRow Step -1 If Range("A" & r).Value = "" Then Rows(r).EntireRow.Delete End If Next End Sub Regards, Per "puiuluipui" skrev i meddelelsen ... Hi, i need a macro to delete empty rows if a cell in A3:A200 is blank. Ex: A B C 3 FILL FILL FILL 4 FILL FILL 5 FILL FILL FILL 6 7 FILL FILL FILL In this example, i need to delete row 4 and 6. Can this be done? Thanks! |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro to delete rows if cell blank in column
It's working.
Thanks! "Gary''s Student" wrote: Sub rowkiller() Set r = Range("A3:A200") Set rr = r.SpecialCells(xlCellTypeBlanks) rr.EntireRow.Delete End Sub -- Gary''s Student - gsnu200907 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to delete blank rows and move data/info | Excel Discussion (Misc queries) | |||
Macro to delete blank rows in a data range | Excel Discussion (Misc queries) | |||
Delete multiple rows where a blank cell is located | Excel Discussion (Misc queries) | |||
To delete rows when more than one cell is blank | Excel Worksheet Functions | |||
Delete blank rows Macro | Excel Discussion (Misc queries) |