Stacy Rueda
Board Regular
- Joined
- Jun 23, 2016
- Messages
- 87
Hi everyone,
I have super urgent project. This is very simple, but as a beginner like me, I don't know how to modify code that I have found in this forum. I've searched it all (but if you find forum regarding this, kindly reply with link in it) but all thread we're asking delete rows in active sheet only, But in my case, I want to delete rows with specific words to another worksheets ("Data"). Can you help me what is wrong for below code, please. Btw, I used command button to delete rows.
The rows to deleted will be "The power of machine was turned on and The power of machine was turned off".
Thank you so much
I have super urgent project. This is very simple, but as a beginner like me, I don't know how to modify code that I have found in this forum. I've searched it all (but if you find forum regarding this, kindly reply with link in it) but all thread we're asking delete rows in active sheet only, But in my case, I want to delete rows with specific words to another worksheets ("Data"). Can you help me what is wrong for below code, please. Btw, I used command button to delete rows.
The rows to deleted will be "The power of machine was turned on and The power of machine was turned off".
Code:
Sub Button2_Click()
This Workbook "Data"
.AutoFilterMode = False
With Range("F1", Range("F" & Rows.Count).End(xlUp))
.AutoFilter 1, "*The power of machine was turned*"
On Error Resume Next
.Offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
End Sub
Thank you so much
Last edited by a moderator: