Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to run a copy code an "x" number of times. The value for "x" is
variable and I would like to declare it within the code for the copy routine. What is the easiest way for a beginner, like me, to write the code? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() x=10 For i = 1 to x 'your copy code Next x -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=135035 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First you need to understand your goal and determine if a loop is the
best way to accomplish it. If so, then you need to decide what type of loop to use. There are several types of loops, but unless you disclose how 'x' is calculated, it would be difficult to suggest the appropriate type. --JP On Sep 15, 4:09*pm, ASteele wrote: I need to run a copy code an "x" number of times. *The value for "x" is variable and I would like to declare it within the code for the copy routine. What is the easiest way for a beginner, like me, to write the code? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Example code............
Sub SheetCopy() Dim x As Long Application.ScreenUpdating = False shts = InputBox("How many times") For x = 1 To shts ActiveSheet.Copy After:=ActiveSheet Next x Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Tue, 15 Sep 2009 13:09:01 -0700, ASteele wrote: I need to run a copy code an "x" number of times. The value for "x" is variable and I would like to declare it within the code for the copy routine. What is the easiest way for a beginner, like me, to write the code? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
returning back to loop check condition without completing the loop | Excel Programming | |||
Loop to Filter, Name Sheets. If Blank, Exit Loop | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming |