LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Copy Unknown Number of Sheets

I have a Macro that prompts the user for a number. The program should then
insert a copy of an existing page that number of times. The program prompts
the user, but then stops before inserting any new pages. Here is what I have
right now. Thank you for all your help!!

Sub CopySheets()
Dim PhaseNum As Double
Dim Count As Double
Dim MinVal As Double
Dim MaxVal As Double
Dim Msg As String
Dim UserEntry As String
MinVal = 1
MaxVal = 20
Msg = "Enter the Number of Program Phases"
Msg = Msg + vbNewLine
Msg = Msg + "Between 1 and 20"
Do
UserEntry = InputBox(Msg)
If UserEntry = "" Then Exit Sub
If IsNumeric(UserEntry) Then
PhaseNum = Val(UserEntry)
If PhaseNum <= MaxVal And PhaseNum = MinVal Then Exit Do
End If
Loop
For Count = 1 To PhaseNum
Sheets("INPUT").Select
Sheets("INPUT").Copy After:=Sheets("INPUT")
Next Count
End Sub



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unknown Number Format Freshman Excel Worksheet Functions 3 June 2nd 09 01:51 PM
COUNTIF across multiple sheets with unknown names andy62 Excel Worksheet Functions 1 April 9th 08 05:42 PM
Unknown Sheets JakeShipley2008 Excel Worksheet Functions 6 June 25th 07 10:09 PM
Unknown number format Don Excel Worksheet Functions 1 September 20th 06 06:17 PM
Copy Contract Number to CenterFooter on multiple sheets BEEJAY Excel Programming 5 December 9th 05 04:51 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"