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
Option Explicit
Sub InsertIt()
Dim LastRow As Long
Dim StartRow As Long
StartRow = ActiveCell.Row
Cells(StartRow + 1, 1).Resize(6, 1).EntireRow.Insert
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
With Range(Cells(StartRow, 1), Cells(LastRow, 1))
.DataSeries Rowcol:=xlColumns, Type:=xlLinear, Date:=xlDay, _
Step:=1, Trend:=False
End With
Application.ScreenUpdating = True
End Sub
--
HTH
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
sandy...@mailinator.com
Replace @mailinator.com with @tiscali.co.uk
"K" <kamra...@yahoo.co.uk> wrote in message
news:0b5c196f-052a-4817...@e25g2000prg.googlegroups.com...
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguil...@austin.rr.com
"K" <kamra...@yahoo.co.uk> wrote in message
news:0b5c196f-052a-4817...@e25g2000prg.googlegroups.com...
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
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
sandy...@mailinator.com
Replace @mailinator.com with @tiscali.co.uk
"K" <kamra...@yahoo.co.uk> wrote in message
news:857962ce-efc1-44f9...@s13g2000prd.googlegroups.com...
To see the syntax for the code turn on the Macro recorder and do what you
want manually then change the "With Selection" of the recorded code to "With
Range(whatever your range is) and then delete the line selecting the range.
--
HTH
Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings
sandy...@mailinator.com
Replace @mailinator.com with @tiscali.co.uk
"K" <kamra...@yahoo.co.uk> wrote in message
news:08fdc94b-5ae2-4697...@d21g2000prf.googlegroups.com...