ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Row (https://www.excelbanter.com/excel-programming/380715-delete-row.html)

Armin Ronacher

Delete Row
 
Hi,

I'd like to find a cell with the content "This cell" and then I'd
like to delete the row (not only the content of the cell). This is
what I've got:

Sub DeleteRow()
With Worksheets(1).Range("A1:H100")
Set C = .Find("This Cell", LookIn:=xlValues)

' Rows(???).Select
' ??? How to select the row to delete ???

Selection.Delete Shift:=xlUp
End With
End Sub

Thanks and regards,
Armin


Tom Ogilvy

Delete Row
 
Sub DeleteRow()
With Worksheets(1).Range("A1:H100")
Set C = .Find("This Cell", LookIn:=xlValues)
if not c is nothing then
c.EntireRow.Delete
End if
End With
End Sub

--
Regards,
Tom Ogilvy


"Armin Ronacher" wrote in message
...
Hi,

I'd like to find a cell with the content "This cell" and then I'd like to
delete the row (not only the content of the cell). This is what I've got:

Sub DeleteRow()
With Worksheets(1).Range("A1:H100")
Set C = .Find("This Cell", LookIn:=xlValues)

' Rows(???).Select
' ??? How to select the row to delete ???

Selection.Delete Shift:=xlUp
End With
End Sub

Thanks and regards,
Armin




Armin Ronacher

Delete Row
 
Tom,
thanks, this is exactly what I was looking for.

Regards
Armin Ronacher


"Tom Ogilvy" schrieb im Newsbeitrag
...
Sub DeleteRow()
With Worksheets(1).Range("A1:H100")
Set C = .Find("This Cell", LookIn:=xlValues)
if not c is nothing then
c.EntireRow.Delete
End if
End With
End Sub

--
Regards,
Tom Ogilvy


"Armin Ronacher" wrote in message
...
Hi,

I'd like to find a cell with the content "This cell" and then
I'd like to delete the row (not only the content of the cell).
This is what I've got:

Sub DeleteRow()
With Worksheets(1).Range("A1:H100")
Set C = .Find("This Cell", LookIn:=xlValues)

' Rows(???).Select
' ??? How to select the row to delete ???

Selection.Delete Shift:=xlUp
End With
End Sub

Thanks and regards,
Armin






All times are GMT +1. The time now is 07:23 PM.

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