Dear Aamir
You can use this also..
Sub Sheet1Multiplecopy()
Dim noOfSheet As Long
Dim strTEmp As String
Dim lngLoop As Long
On Error Resume Next
strTEmp = InputBox("Enter no of Sheets:-", "Sheet Number")
On Error GoTo 0: On Error GoTo -1: Err.Clear
noOfSheet = IIf(IsNumeric(strTEmp), strTEmp, 0)
If noOfSheet > 0 Then
For lngLoop = 1 To noOfSheet
Sheets("Sheet1").Copy After:=Sheets(lngLoop)
ActiveSheet.Name = lngLoop
Next lngLoop
End If
End Sub
Regards,
Lalit Mohan
https://www.facebook.com/buzinesstransformation
On Sun, May 13, 2012 at 2:07 AM, dguillett1 <[email protected]> wrote:
> Sub Sheet1Multiplecopy()
> Dim i As Long
> For i = 1 To InputBox("howmany")
> Sheets("Sheet1").Copy After:=Sheets(i)
> ActiveSheet.Name = i
> Next i
> End Sub
>
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> [email protected]
>
> From: Aamir Shahzad
> Sent: Saturday, May 12, 2012 2:40 PM
> To: [email protected]
> Subject: Re: $$Excel-Macros$$ amend in macro
>
> error reflecting, see the attached snapshot.
>
> On Sun, May 13, 2012 at 12:13 AM, dguillett1 <[email protected]> wrote:
>>
>> For i = 1 To inputbox(“how many”)
>>
>> Don Guillett
>> Microsoft MVP Excel
>> SalesAid Software
>> [email protected]
>>
>> From: Aamir Shahzad
>> Sent: Saturday, May 12, 2012 1:51 PM
>> To: [email protected]
>> Subject: $$Excel-Macros$$ amend in macro
>>
>> Dear Group,
>>
>> Following macro provided by anyone in this forum & this code is working
>> fine but I want to amend into this coding e.g. when run this code it should
>> ask by msg box "How many sheets do you want to add?" then take the input e.g
>> 10 or any number then add sheets which given by user. Kindly do the needful.
>> Thanks in advance.
>>
>> Sub Sheet1Multiplecopy()
>> Dim i As Integer
>> i = 1
>> For i = 1 To 100
>> Sheets("Sheet1").Select
>> Sheets("Sheet1").Copy After:=Sheets(i)
>> ActiveSheet.Name = i
>> Next
>> End Sub
>>
>>
>> Regards,
>>
>> Aamir Shahzad
>>
>>
>> --
>> FORUM RULES (986+ members already BANNED for violation)
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
>> not get quick attention or may not be answered.
>>
>> 2) Don't post a question in the thread of another member.
>>
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>>
>> 4) Acknowledge the responses you receive, good or bad.
>>
>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>> signatures are prohibited.
>>
>> NOTE : Don't ever post personal or confidential data in a workbook. Forum
>> owners and members are not responsible for any loss.
>>
>>
>> ------------------------------------------------------------------------------------------------------
>> To post to this group, send email to [email protected]
>> --
>> FORUM RULES (986+ members already BANNED for violation)
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
>> not get quick attention or may not be answered.
>>
>> 2) Don't post a question in the thread of another member.
>>
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>>
>> 4) Acknowledge the responses you receive, good or bad.
>>
>> 5) Cross-promotion of, or links to, forums competitive to this forum in
>> signatures are prohibited.
>>
>> NOTE : Don't ever post personal or confidential data in a workbook. Forum
>> owners and members are not responsible for any loss.
>>
>>
>> ------------------------------------------------------------------------------------------------------
>> To post to this group, send email to [email protected]
>
>
>
>
> --
>
> Regards,
>
> Aamir Shahzad
>
>
> --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
> not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to [email protected]
>
> --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
> not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to [email protected]
--
FORUM RULES (986+ members already BANNED for violation)
1) Use concise, accurate thread titles. Poor thread titles, like Please Help,
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited.
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
------------------------------------------------------------------------------------------------------
To post to this group, send email to [email protected]