Hi everyone,

I am quite new to the VB programming world but in a few days I learnt quite a lot

I want to create a message box that would pop up after a click on a button in sheet1 and according to the input value x, the macro will copy x-1 times the sheet 2.

I wrote this code but no matter the number between 2 and 4, it will always copy only once the sheet2. For x=1, no copy is needed.

Sub NbOfSheet2ToCopy()
x = InputBox("How many copies of Sheet2 would you like? Please enter a number between 1 and 4")
If x >= 1 Or x <= 4 Then
numtimes = x - 1
Sheets("Sheet2").Copy _
After:=ActiveWorkbook.Sheets("Sheet2")
Sheets("Sheet2").Select
Else: MsgBox ("Please enter a number between 1 and 4")
End If
End Sub

Is it possible to have the copied sheets in order ?

Thank you for your help !