OOps, typos --

Sub Sheet1Multiplecopy()

Dim s1 as worksheet, n as long

    set s1=worksheets(1)

    For n = msgbox("How many sheets do you want to add?") to 1 step -1

        s1.Copy After:=s1

        ActiveSheet.Name = n

    Next

    s1.select

End Sub

 

 

From: Asa Rossoff [mailto:a...@lovetour.info] 
Sent: Saturday, May 12, 2012 12:06 PM
To: 'excel-macros@googlegroups.com'
Subject: RE: $$Excel-Macros$$ amend in macro

 

Sub Sheet1Multiplecopy()

Dim s1 as worksheet, n as long, c as long

    c = worksheets.count

    set s1=worksheets(1)

    For n = msgbox("How many sheets do you want to add?) to 1 step -1

        s1.Copy After:=s1

        ActiveSheet.Name = n

    Next

    s1.select

End Sub

 

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of Aamir Shahzad
Sent: Saturday, May 12, 2012 11:52 AM
To: excel-macros@googlegroups.com
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 excel-macros@googlegroups.com

-- 
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 excel-macros@googlegroups.com

Reply via email to