Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Input Box Trouble

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Input Box Trouble

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Input Box Trouble

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
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
Trouble With Text Input Fellow Excel Discussion (Misc queries) 2 July 15th 09 08:45 PM
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
Trouble with saving user input in an Excel Form. University of Maine student Excel Discussion (Misc queries) 0 March 14th 06 07:31 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 07:41 PM.

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"