Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can be more detailed that this, but it can get you
going in the right direction. 'Understand that you must determine how many columns are necessary to check Sub Delete_Rows () r = 1 'Check each Row Do If Not IsEmpty(Cells(r,c)) Then 'Check each column within that row Do Until c = 7 'Checks until the 7th column If IsEmpty(Cells(r,c + 1)) Then Cells(r,c).EntireRow.Delete Else c = c + 1 End If Loop End If 'Set up for next row c = 1 r = r + 1 Loop Until IsEmpty(Cells(r,c)) 'Assumes that at least column A will not be missing data. End Sub ---Original Message----- Hello, Can anyone write me a quick VBA example to delete an entire row if a particular cell within that row is empty? I need excel to do this to multiple rows until it gets to the end of the data. Anyone? . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA code to delete rows | Excel Discussion (Misc queries) | |||
Quick Macro question - How to delete two rows then skip one - and repeat | Excel Discussion (Misc queries) | |||
Is there a quick way to delete all duplicate rows in a column? | Excel Discussion (Misc queries) | |||
code to delete rows | Excel Discussion (Misc queries) | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming |