Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Find a cell then delete the row

One way for column A

Sub test()
Dim Rng As Range
Dim FindString As String
Dim RngFound As Boolean
FindString = "BASE"
Application.ScreenUpdating = False
Do
Set Rng = Range("A:A").Find(What:=FindString, LookAt:=xlWhole)
If Not Rng Is Nothing Then Rng.EntireRow.Delete: RngFound = True
Loop While Not (Rng Is Nothing)

Application.ScreenUpdating = True
If Not RngFound Then MsgBox "No " & FindString & " entries were found"
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Jessi" wrote in message om...
I'm very new to writing code of any kind and I don't really know where
to start with this.

I want to find a cell (I always know the column) and then delete the
whole row.

This is what I have that doesn't work at all:



Sub FindBASE()

' This should delete the BASE row

If ActiveSheet.Range("A1:A100").Value = "BASE" Then
ActiveCell.EntireRow.Delete
End If

End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find last cell in a column, Delete its contents and make it active George Excel Worksheet Functions 5 January 28th 10 05:38 PM
Find last cell in a column, Delete its contents and make it ac Don Guillett[_2_] Excel Worksheet Functions 1 January 28th 10 04:56 PM
find cell that contains text and delete entre row Cristi R Excel Discussion (Misc queries) 3 August 2nd 06 04:32 PM
FIND THE CALCULATED VALUE OF A CELL AND DELETE IT FROM ANOTHER dcozzi Excel Discussion (Misc queries) 2 April 18th 06 07:06 PM
Find a cell then delete the row Bob Phillips[_5_] Excel Programming 0 July 28th 03 04:52 PM


All times are GMT +1. The time now is 10:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"