ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   copy worksheet multiple times base on user's input (https://www.excelbanter.com/excel-worksheet-functions/146659-copy-worksheet-multiple-times-base-users-input.html)

[email protected]

copy worksheet multiple times base on user's input
 
Im hoping someone could show me how to code this. How do I copy a
worksheet x number of times? The user will have to enter then number
in a cell and upon cell selection change, I want Excel to
automatically copy the worksheet.

Sheet1 = has cell "howMany" (where user would enter the number of
worksheets needed)
Sheet2 = is the worksheet to be copied multiple times


Thanks a bunch


Sharon


[email protected]

copy worksheet multiple times base on user's input
 
nvm. I figured it out.



Don Guillett

copy worksheet multiple times base on user's input
 
Sub askforsheetstocopy()
For i = 1 To Range("d1").Value
Sheets("xxx").Copy after:=Sheets(Sheets.Count)
Next i
End Sub

or just ask for input

Sub askforsheetstocopy()
For i = 1 To inputbox("how many sheets")
Sheets("xxx").Copy after:=Sheets(Sheets.Count)
Next i
End Sub

--
Don Guillett
SalesAid Software

wrote in message
ups.com...
Im hoping someone could show me how to code this. How do I copy a
worksheet x number of times? The user will have to enter then number
in a cell and upon cell selection change, I want Excel to
automatically copy the worksheet.

Sheet1 = has cell "howMany" (where user would enter the number of
worksheets needed)
Sheet2 = is the worksheet to be copied multiple times


Thanks a bunch


Sharon




All times are GMT +1. The time now is 06:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com