copy activesheet multiple times after the same acrtive sheet

  • i have a code to copy the active sheet multiple time(user defined) after the same active sheet but dont know why it is giving error

    Sub CopysheetMultipleTimes()

    Application.DisplayAlerts = False

    Application.ScreenUpdating = False

    Dim i As Variant

    Dim p As Integer

    Dim sh As Worksheet

    Set sh = ThisWorkbook.ActiveSheet

    On Error GoTo out

    i = Application.InputBox("How many copies do you what?", "Rochem Inspectors")

    If i = False Then GoTo out

    p = 0


    ActiveSheet.Copy After:=ActiveWorkbook.Worksheets(sh)

    p = p + 1

    Loop Until p = i

    Exit Sub


    MsgBox "Copy Was Cancelled", , "Rochem Inspectors"

    Application.DisplayAlerts = True

    Application.ScreenUpdating = True

    End Sub

  • You still are ignoring the rules despite being asked to read them.

    Message me when you have and intend using them and I will open your question for answers.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!