Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi Everyone
I have a table with column A to J fill with data and in column F i have Inactive and Active I want to delete only rows that is Inactive and the active fill all empty rows with vba Thanks for ur usual help Bakar Thanks very much you r the best Last edited by Bakar : November 19th 12 at 01:58 PM Reason: solved |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Am Sun, 18 Nov 2012 13:28:46 +0000 schrieb Bakar: I have a table with column A to J fill with data and in column F i have Inactive and Active I want to delete only rows that is Inactive and the active fill all empty rows with vba try: Sub Test1() Dim LRow As Long Dim SRow As Long With ActiveSheet LRow = .Cells(.Rows.Count, "F").End(xlUp).Row ..Range("A1:J" & LRow).Sort Key1:=Range("F1"), _ Order1:=xlAscending, Header:=xlYes SRow = WorksheetFunction.Match("Inactive", Range("F1:F" & LRow), 0) .Rows(SRow & ":" & LRow).Delete End With End Sub or: Sub Test2() Dim LRow As Long Dim i As Long LRow = Cells(Rows.Count, "F").End(xlUp).Row For i = LRow To 2 Step -1 If Cells(i, "F") = "Inactive" Then Rows(i).Delete End If Next End Sub Regards Claus Busch -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Allowing Delete Table Rows at a Cells Protected Worksheet | Excel Discussion (Misc queries) | |||
delete all blank rows in a table | Excel Programming | |||
Delete all Blank Rows from data table | Excel Programming | |||
Coded to delete extra rows after pivot table | Excel Programming | |||
Code to Delete Empty Rows in a Word Table | Excel Programming |