Insert rows under conditions

christopixie

New Member
Joined
Oct 3, 2014
Messages
2
hello guys!
a vba begginer calling from athens greece, using a 2003 MS Office.
my problem is like that: i have almost 6000 rows and 8 columns. data are ordered by two columns B and E.
column B is from 01 to 99 and in each number corresponds amost 80 ordered numbers in column E.
the problem is that numbers in column E do not increase by 1, row after row, as i would like.
so i need to insert rows under each row to make that happen and in these rows there will be data copied from some columns or zeros to the rest of them.

thanx a lot.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Welcome to the forum

If you could just post some sample(fictitious if necessary) data showing us the before(the code runs) and after results, that would help
 
Upvote 0
BEFORE
A
B
C
D
E
F
G
H
1
year
groups
code 1
code 2
age
m
f
total
2
2013
01
D
45
103
2
1
3
3
2013
01
D
45
106
0
2
2
4
2013
02
B
32
3
4
1
5
5
2013
02
B
32
6
3
2
5
AFTER
1
2013
01
D
45
103
2
1
3
2
2013
01
D
45
104
0
0
0
3
2013
01
D
45
105
0
0
0
4
2013
01
D
45
106
0
2
2
5
2103
02
B
32
00
0
0
0
6
2013
02
B
32
01
0
0
0
7
2013
02
B
32
02
0
0
0
8
2013
02
B
32
03
4
1
5
9
2013
02
B
32
04
0
0
0
10
2013
02
B
32
05
0
0
0
11
2013
02
B
32
06
5
2
5

<tbody>
</tbody>

NOotice that data are sorted 1st by column B and 2nd by column E and we must have a perfect numbering in col E from 0 to the largest age for each GROUP in column B.



columns a,b,c,d of the inserted Lines 2 and3 take values from GROUP 01of col b
whereas inserted Lines 5,6,7,9,10 take values from GROUP 02 of column b.
columns F, G, H of the inserted Lines they all take 0.
 
Upvote 0

Forum statistics

Threads
1,214,789
Messages
6,121,605
Members
449,038
Latest member
Arbind kumar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top