Not quite what i am looking for lets try it again
my data is as follows
Ctu25 (names)
18
15
23
24
16
18
Ctu26 (names)
22
21
20
15
17
ctu32(names)
21
24
32
32
21
13
i need to count the rows between the names if it is 6 rows do nothing if not
add the missing rows and a zero as a place holder
6 rows between every name the data sometimes give me 3 or 5
"Simon Lloyd" wrote:
calvin;344314 Wrote:
I have Names begining with the letter C (c1205, c4356, c8609) i need 6
rows
between every name, the data i import dosent always follow this rule so
i
need to insert the number of missing rows and also add a 0 to the rows
i
insert.I would need some dummy data/workbook to workout the counting missing
rows, however this code will insert 6 rows for each instance and add
zero.
Code:
--------------------
Sub Insert_6_rows_add_0()
Dim i As Long
For i = Range("A" & Rows.Count).End(xlUp).Row To 7 Step -1
Rows(i & ":" & i - 5).EntireRow.Insert
Range("A" & i & ":A" & i - 5).Value = 0
Next i
End Sub
--------------------
--
Simon Lloyd
Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=96336