Executing a Macro by passing a string parameter


I am trying to execute a macro by passing a string parameter. I want to delete the Sheet by providing the sheet name as parameter in the Macro. It is getting executed but it is not performing the required action. Used a message box to check whether the parameter is getting passed properly. The message box is displaying the correct value. Can anyone help me out in this.

Thank you

hi @PJain
you can use the below code and let us know
Sub SheetKiller()
Dim s As Worksheet, t As String
Dim i As Long, K As Long
K = Sheets.Count

For i = K To 1 Step -1
    t = Sheets(i).Name
    If t = "ID Sheet" Or t = "Summary" Then
        Application.DisplayAlerts = False
        Application.DisplayAlerts = True
    End If
Next i

End Sub

Ashwin S

Thanks Ashwin.
Will surely try this and get back to you.