Thread: Looping Code
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
tpeter tpeter is offline
external usenet poster
 
Posts: 74
Default Looping Code

Awsome,

Thank both of you so much, I have been pulling my hair out.

"Jacob Skaria" wrote:

You dont need to loop. Try the below

Sub Macro2()
Range("C15:K15").Copy
Range("C15").Resize(Range("M2") - 1).Insert Shift:=xlDown
Application.CutCopyMode = False
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"tpeter" wrote:

I have that attached code that I want to run based and the number of cell m2.
So if cell m2 = 5 I would like the copy and insert to happen 4 times. This is
for a custom form made by the end user. Any help would be great, I have never
tried to loop the same code over again.

Range("C15:K15").Select
Selection.Copy
Range("C15").Select
Selection.Insert Shift:=xlDown (need this to happen # of times
inidicated in cell m2)

Tim Peter