Thread
:
MACRO TO INSERT ROWS
View Single Post
#
5
Posted to microsoft.public.excel.programming
Sandy Mann
external usenet poster
Posts: 2,345
MACRO TO INSERT ROWS
If that is what you want then it is fine but be warned that it will throw a
error 1004 at line:
With Range(Cells(StartRow, 1), Cells(LastRow, 1))
if you select Row 1
--
Regards,
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
Replace @mailinator.com with @tiscali.co.uk
"K" wrote in message
...
On Feb 15, 1:51 pm, "Don Guillett" wrote:
One way to find the number 2 and insert rows and renumber column
Sub addrows_renumber()
rti = 5
rta = Columns(1).Find(2).Row + 1
Rows(rta & ":" & rta + rti).Insert
lr = Cells(Rows.Count, "a").End(xlUp).Row
Range("A1:A" & lr).DataSeries step:=1, Stop:=lr
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"K" wrote in message
...
Hi, I have numbers in coloumn "A" (Please see below)
A
1
2
3
4
5
I want macro which should add 6 rows between those numbers
which I mentioned above then put numbers back in sequense.
For example macro should add 6 rows from row 2 in which I have
number "2" in coloumn "A" cell 2 and once rows been added then
there will be no numbers in those added rows coloumn "A" cells so
macro should go in cell "A1" and put numbers back in sequense
LIKE :-
ADDED ROWS BY MACRO
1
2
row added
row added
row added
row added
row added
row added
3
4
5
PUT NUMBER BACK IN SEQUENSE OR DRAG NUMBERS
1
2
3
4
5
6
7
8
9
10
11
Please if any body can help- Hide quoted text -
- Show quoted text -
Thanks Sandy i did little changing in your macro and i got what i want
i just changed this line
StartRow = Cells(Rows.Count, 1).End(xlUp).Row
to
StartRow = Cells(Rows.Count, 1).End(xlUp).Row - 1
Thanks Don to you aswell as your Macro was also helpful
Reply With Quote
Sandy Mann
View Public Profile
Find all posts by Sandy Mann