Jagdev Singh
Active Member
Hi Experts
I have a excel sheet with contains data which I need to delete from each section of the sheet.
** PART OF
USD
AND COMPRISES THE FOLLOWING POSTINGS
1.00
A
123.00
A
123.00
A
14.00
A
12.00
A
12.00
A
12.00
A
12.00
A
11.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
The section is available in the sheet in 3 sections. Instead of deleting it manually can we delete via VBA. I tried to record the macro, but it doesn’t fulfill the need. The common thing in the section is "AND COMPRISES THE FOLLOWING POSTINGS "
I have a excel sheet with contains data which I need to delete from each section of the sheet.
** PART OF
USD
AND COMPRISES THE FOLLOWING POSTINGS
1.00
A
123.00
A
123.00
A
14.00
A
12.00
A
12.00
A
12.00
A
12.00
A
11.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
12.00
A
The section is available in the sheet in 3 sections. Instead of deleting it manually can we delete via VBA. I tried to record the macro, but it doesn’t fulfill the need. The common thing in the section is "AND COMPRISES THE FOLLOWING POSTINGS "
Code:
Sub Macro1()
'
' Macro1 Macro
'
'
Range("E3").Select
Selection.Copy
Cells.Find(What:=" AND COMPRISES THE FOLLOWING POSTINGS", After:=ActiveCell _
, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
Range("A3:M21").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
End Sub
Attachments
Last edited: