ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find a cell then delete the row (https://www.excelbanter.com/excel-programming/272844-re-find-cell-then-delete-row.html)

Bob Phillips[_5_]

Find a cell then delete the row
 
Jessi,

I think this will work

Sub FindBase()
Dim c As Range
On Error Resume Next
Set c = Range("A1:A100").Find(what:="BASE", LookIn:=xlValues)
On Error GoTo 0
If Not c Is Nothing Then
c.EntireRow.Delete
End If
End Sub


--

HTH

Bob Phillips

"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





All times are GMT +1. The time now is 08:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com