'Creating a New Sheet and copying the data in that sheet from
Sub CopyPaste2()
With Worksheets("Sheet1")
ActiveSheet.Select
Selection.Copy
End With
Dim WS As Worksheet
Set WS = Sheets.Add
ActiveSheet.Paste 'pastes the copied data
ActiveSheet.Name = "Test" 'renames the sheet2 to test
End Sub
Sub substringdelete()
Dim rcnt As Long, col As Integer
rcnt = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row
col = 3
For i = 2 To rcnt
While Sheets("Sheet1").Cells(i, col).Value <> ""
If InStr(1, Sheets("Sheet1").Cells(i, col).Value, "good morning") > 0 Then
Sheets("Sheet1").Rows(i & ":" & i).Delete
End If
col = col + 1
Wend
col = 3
Next
End Sub
Bookmarks