Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to make it so that when a user inputs the amount of trips they
have taken, Excel automatically copys that amount of worksheets. I made a Macro that copys the worksheets but im not sure how to integrate that into an input box. the copy sheet code: Sheets("Individual Trip").Select Sheets("Individual Trip").Copy After:=Sheets(3) Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 28 Apr., 16:40, Ewing25 wrote:
I am trying to make it so that when a user inputs the amount of trips they have taken, Excel automatically copys that amount of worksheets. I made a Macro that copys the worksheets but im not sure how to integrate that into an input box. the copy sheet code: * Sheets("Individual Trip").Select * * Sheets("Individual Trip").Copy After:=Sheets(3) Thanks! Hi Try this Sub TripsCopy() Dim Trips As Integer Dim tr As Integer Trips = InputBox("Enter no. of trips") If Trips 0 Then 'Sheets("Individual Trip").Select For tr = 1 To Trips Sheets("Individual Trip").Copy After:=Sheets(Sheets.Count) Next End If End Sub Regards, Per |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That worked great thanks!!
"Per Jessen" wrote: On 28 Apr., 16:40, Ewing25 wrote: I am trying to make it so that when a user inputs the amount of trips they have taken, Excel automatically copys that amount of worksheets. I made a Macro that copys the worksheets but im not sure how to integrate that into an input box. the copy sheet code: Sheets("Individual Trip").Select Sheets("Individual Trip").Copy After:=Sheets(3) Thanks! Hi Try this Sub TripsCopy() Dim Trips As Integer Dim tr As Integer Trips = InputBox("Enter no. of trips") If Trips 0 Then 'Sheets("Individual Trip").Select For tr = 1 To Trips Sheets("Individual Trip").Copy After:=Sheets(Sheets.Count) Next End If End Sub Regards, Per |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trouble With Text Input | Excel Discussion (Misc queries) | |||
How to input pictures automatically based on cell input? | Excel Worksheet Functions | |||
input in number form is being multiplied by 1000 when i input. | Excel Discussion (Misc queries) | |||
Trouble with saving user input in an Excel Form. | Excel Discussion (Misc queries) | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming |