Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank You so much! This is exactly what I needed.
"David" wrote: Hi, Don't know what you have as far as data goes, but the loop needs to start ot the top. This is your code with one line moved to the top. Thanks, Do Until ActiveCell.Value = "" 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 Loop "Carmen" wrote: 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop a macro | Excel Programming | |||
macro loop | Excel Discussion (Misc queries) | |||
macro loop | Excel Programming | |||
Do...Loop Macro | Excel Programming | |||
Using for loop in a macro | Excel Programming |