Thread: Loop Macro?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Loop Macro?

which bit do you want to loop around?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Carmen" wrote in message
...
I am trying to get the following macro to loop until reaching the end of

the
data (length will not be standard every time). But when I run, it gets

stuck
- any suggestions?

Thanks

ActiveCell.Rows("1:1").EntireRow.Select
Selection.Insert Shift:=xlDown
ActiveCell.Select
ActiveCell.FormulaR1C1 = "#"
ActiveCell.Offset(2, 0).Rows("1:1").EntireRow.Select
Selection.Insert Shift:=xlDown
ActiveCell.Offset(-1, 1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Range("A1").Select
Do Until ActiveCell.Value = ""
Loop



End Sub