Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if not, and as stated it isn't, then you can use this
Sub Test() Dim rng As Range Set rng = Columns(1).SpecialCells(xlCellTypeBlanks) Set rng = Intersect(rng.EntireRow, Range("A:B")) rng.Delete shift:=xlShiftUp End Sub to just delete the cells in columns A and B where the cell in A is blank. -- Regards, Tom Ogilvy "Dave Ramage" wrote in message ... This should be about the quickest way, as long as it is acceptable to delete the entire row. Select the cells in column A then run it. Sub Test() Selection.SpecialCells(xlCellTypeBlanks).EntireRow .Delete End Sub Cheers, Dave -----Original Message----- I need to write a macro to run through a list of values in column A and B. If column A is blank, then I have to delete cells A and B correspondingly. Is it very difficult to do that? --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete row if 2 cells are empty | Excel Discussion (Misc queries) | |||
delete cells column. Delete empty cells | Excel Worksheet Functions | |||
How to delete at once empty columns in a table? | Excel Discussion (Misc queries) | |||
How do I delete rows where cells are empty | Excel Discussion (Misc queries) | |||
delete rows with empty cells | Excel Discussion (Misc queries) |