Home |
Search |
Today's Posts |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
your change would have been
Row(i + 1).Value = Row(i).Value That would work if you know before hand that all the values are constants and not formulas or you want to change any formulas to constants. Unfortunately, I don't know that. So I used FillDown -- Regards, Tom Ogilvy wrote in message ... Tom Ogilvy wrote: Yes, you should say what you mean. You said rows existing and then showed a single column of numbers. Here is an adjustment. Sub AddRows() Dim lastrow As Long, i As Long lastrow = Cells(Rows.Count, 1).End(xlUp).Row For i = lastrow To 1 Step -1 Rows(i + 1).Insert Rows(i + 1).FillDown Next End Sub Sorry, Apologize for that, Yes that last does the trick. I did try tweaking it, wondering if just changing the Cells(i + 1, 1).Value = Cells(i, 1).Value to Row(i + 1, 1).Value = Row(i, 1).Value was the answer, but I never would have got it to continue without your code knowledge. I usually will try to trial and error it till I learn it but sooner or later I guess I need to get some real VBA training. Thanks much for all the help, gonna save me hours of work tomorrow Cheers |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cannot Move, Copy, Insert, Rename, or Delete a Worksheet in Any Wo | Excel Discussion (Misc queries) | |||
Macro to insert and move columns | Excel Discussion (Misc queries) | |||
I am unable to insert, move, copy a worksheet | Excel Discussion (Misc queries) | |||
Move/Copy or Copy/Insert worksheet? | Excel Discussion (Misc queries) | |||
Help please on a simple macro to insert rows | Excel Programming |