Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Am Mon, 20 May 2013 04:38:43 +0100 schrieb gemiho: I wonder if you please could help me with a macro; I just started to use VBA, so my knowledge is equal zero. I have a workbook with a few sheets. I am trying to write a macro that after clicking on a cell it deletes the entire row if the cell in column A does not contain any text; actually I wanted it to do not delete the row if the cell in column A contains the text “keepThisRow”, but I do not know how to do it. I was thinking to use a Form button. If you have no headers in your table change A2 to A1: Sub DeleteRows() Dim LRow As Long With ActiveSheet LRow = .Cells(Rows.Count, 1).End(xlUp).Row .Unprotect "123" .UsedRange.AutoFilter Field:=1, Criteria1:= _ "<*ThisRow*" .Range("A2:A2" & LRow).EntireRow.Delete .AutoFilterMode = False .Protect "123" End With End Sub Regards Claus Busch -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete commas and spaces when not needed ... S&R way, or macro way? | Excel Programming | |||
Macro needed to identify value and delete row if value below targe | New Users to Excel | |||
Help needed with find & Delete | Excel Programming | |||
Macro needed to delete rows | Excel Programming | |||
delete code needed | Excel Programming |