• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Merge the code

Hi,

I have 3 codes below.. Can you please merge it into single coding. I am using call option 3 times.


Code:
Sub Plan001()
    Dim A As Range
    Dim SrchRng

    Set SrchRng = ActiveSheet.Range("A1", ActiveSheet.Range("A65536").End(xlUp))
    Do
        Set A = SrchRng.Find("PLAN 0-00001", LookIn:=xlValues)
        If Not A Is Nothing Then A.EntireRow.Delete
    Loop While Not A Is Nothing
End Sub


Sub DeleteCodes()
    Dim B As Range
    Dim SrchRng

    Set SrchRng = ActiveSheet.Range("B1", ActiveSheet.Range("B65536").End(xlUp))
    Do
        Set B = SrchRng.Find("..CODES..", LookIn:=xlValues)
        If Not B Is Nothing Then B.EntireRow.Delete
    Loop While Not B Is Nothing
End Sub


Sub DeleteRejectmsg()
    Dim B As Range
    Dim SrchRng

    Set SrchRng = ActiveSheet.Range("B2", ActiveSheet.Range("B65536").End(xlUp))
    Do
        Set B = SrchRng.Find("REJECT MESSAGES", LookIn:=xlValues)
        If Not B Is Nothing Then B.EntireRow.Delete
    Loop While Not B Is Nothing
End Sub
-------------------------------------------------------------------------------------------
MOD EDIT: Added Code tag.
 
Last edited by a moderator:
Back
Top