How do I insert rows in excel using macro?

March 14, 2011 at 12:29:03
Specs: Windows 7
I am trying to insert 3 rows (after each line, starting at X row) and I want to add text on the inserted row at (Y column). Please help.

See More: How do I insert rows in excel using macro?

Report •

#1
March 14, 2011 at 17:43:42
Im not sure I understand what you mean completely.... but you can very easily add 3 rows by Highlighting three rows where you want them to be inserted (highlight rows 9-11 if you want the content in row 9-11 pushed down three rows) right-click and select insert....

but im probably a bit confused with your reference of Rox "X" and Column "Y"

I'd say practice inserting rows like that and then if you'd like try recording a macro of you doing the same thing and see how that works for ya!

Best of luck!


Report •

#2
March 14, 2011 at 23:35:20
I think I wasn't very clear with what I needed help with...sorry.

I have a report that I have to do on a weekly basis. This report consist of part number, mfr part numbers, etc. I need to insert 3 rows after each part number. And on the inserted rows, I need to add a text on colum C

A B C D
1
2
3 XYZ ABC QTY 6
4 GHI CDF QTY 9
5 TUV GHI QTY 11

Here's what I want it to look after adding 3 rows and the text

A B C D
1
2
3 XYZ ABC QTY 6
4 ORD
5 FRCST
6 TOTAL
7 GHI CDF QTY 9
8 ORD
9 FRCST
10 TOTAL
11 TUV GHI QTY 11
12 ORD
13 FRCST
14 TOTAL

I have from 200 partnumbers to 300 that I have to insert the 3 row (along with the text), starting at a certain row (row 3 on my example above). I want to create a macro (VBA) so I can automate the inserting of the rows and adding the text. Usually rows 1 & 2 are headers.

Thanks....


Report •

#3
March 14, 2011 at 23:38:35
Just a clarification on my sample...
ABCD are columns in my spreadsheet
123... are the rows
The text ORD, FRCST, & TOTAL are in column C

Report •
Related Solutions


Ask Question